Jump to content

DaDonik

Members
  • Posts

    376
  • Joined

  • Last visited

Everything posted by DaDonik

  1. DaDonik

    Fixed Joint?

    I use FixedJoints to glue my spaceships together. The spaceship itself can freely rotate in space and i have not encountered any type of "child movement" as you described Rick. Maybe it's just because of the character controller.
  2. Looks right, i would say.
  3. Just ask, no one here bites AFAIK
  4. The normal vector is the direction of the impact an thus also the direction of movement before the impact. Or did i get you wrong?
  5. You could also use the callback functions. The UpdateCallback will be called once per loop and even delivers you the entity for which the callback is called. I use this approach and have no problems so far. Due to the fact that the game loop does not know anything about the game entities, you have to send informaton via messages, but that works fine.
  6. No problems with any lights here. The only thing i can think of is that only one directional ligh is supported atm. But thats not an issue at all
  7. Some of you don't use the entity's user data It's such an awesome feature!! Maybe this example will help you It's an example i pasted together from my code, so don't expect it to work via copy&paste. In the ProccessScene function you can call CPlayer* NewPlayer = new CPlayer (_Entity, _RootEntity); assuming that _Entity is the currently processed entity and _RootEntity is some global entity for message handling. After executing that line, the player has a pointer to it's own CPlayer class instance as it's entity user data. It can access that user data (CPlayer class) on every callback. Actually this is why i love Leadwerks ///////////////////////////////////////////////////////////////////////////// /// This class represents the user data (UD) of the player. ///////////////////////////////////////////////////////////////////////////// class CPlayer { public: ///////////////////////////////////////////////////////////////////////// /// Do everything needed to get the entity ready. /// /// \param _Entity The entity the user data corresponds to /// \param _RootEntity The main entity of the game ///////////////////////////////////////////////////////////////////////// CPlayer (TEntity _Entity, TEntity _RootEntity) { this->Init (); // Remember the entity, this class belongs to this->m_Entity = _Entity; // Remember the game global root entity this->m_RootEntity = _RootEntity; // Set this class as the user data of the entity SetEntityUserData (this->m_Entity, (byte*)this); // Enable callbacks, which will further control the entity and it's // behaviour. ENTITYCALLBACK_FREE should always be used, to free // dynamically allocated memory. Just comment out he ones not needed, or // leave them as they are. // Called when the entity is freed for some reason. SetEntityCallback (this->m_Entity, (byte*)GECPlayer::CBFree, ENTITYCALLBACK_FREE); // Called once per frame. SetEntityCallback (this->m_Entity, (byte*)GECPlayer::CBUpdate, ENTITYCALLBACK_UPDATE); // Called whenever the entity moves or rotates. SetEntityCallback (this->m_Entity, (byte*)GECPlayer::CBUpdateMatrix, ENTITYCALLBACK_UPDATEMATRIX); // Called 60 times per second, independent of the framerate. SetEntityCallback (this->m_Entity, (byte*)GECPlayer::CBUpdatePhysics, ENTITYCALLBACK_UPDATEPHYSICS); // Called whenever a collision occurs. SetEntityCallback (this->m_Entity, (byte*)GECPlayer::CBCollision, ENTITYCALLBACK_COLLISION); // Called when the entity Receives a message. SetEntityCallback (this->m_Entity, (byte*)GECPlayer::CBMessageReceive, ENTITYCALLBACK_MESSAGERECEIVE); // Do whatever needed to initialize } ///////////////////////////////////////////////////////////////////////// /// Standard destructor. ///////////////////////////////////////////////////////////////////////// ~CPlayer (); private: ///////////////////////////////////////////////////////////////////////// /// Called when the entity is freed for some reason. ///////////////////////////////////////////////////////////////////////// static void _stdcall CBFree (TEntity entity) { GECPlayer* pUD = (GECPlayer*)GetEntityUserData (entity); if (NULL != pUD) { delete pUD; } } ///////////////////////////////////////////////////////////////////////// /// Called once per frame. ///////////////////////////////////////////////////////////////////////// static void _stdcall CBUpdate (TEntity entity) { CPlayer* pUD = (CPlayer*)GetEntityUserData (entity); if (NULL != pUD) { } } ///////////////////////////////////////////////////////////////////////// /// Called whenever the entity moves or rotates. ///////////////////////////////////////////////////////////////////////// static void _stdcall CBUpdateMatrix (TEntity entity) { CPlayer* pUD = (CPlayer*)GetEntityUserData (entity); if (NULL != pUD) { } } ///////////////////////////////////////////////////////////////////////// /// Called 60 times per second, independent of the framerate. ///////////////////////////////////////////////////////////////////////// static void _stdcall CBUpdatePhysics (TEntity entity) { CPlayer* pUD = (CPlayer*)GetEntityUserData (entity); if (NULL != pUD) { } } ///////////////////////////////////////////////////////////////////////// /// Called whenever a colision occurs. ///////////////////////////////////////////////////////////////////////// static void _stdcall CBCollision ( TEntity entity0, TEntity entity1, byte* position, byte* normal, byte* force, flt speed ) { CPlayer* pUD = (CPlayer*)GetEntityUserData (entity0); if (NULL != pUD) { TVec3 VecPosition; memcpy (&VecPosition, position, sizeof (TVec3)); TVec3 VecForce; memcpy (&VecForce, force, sizeof (TVec3)); TVec3 VecNormal; memcpy (&VecNormal, normal, sizeof (TVec3)); } } ///////////////////////////////////////////////////////////////////////// /// Called when the entity Receives a message. ///////////////////////////////////////////////////////////////////////// static void _stdcall CBMessageReceive ( TEntity entity, char* message, byte* extra) { CPlayer* pUD = (CPlayer*)GetEntityUserData (entity); if (NULL != pUD) { } } ///////////////////////////////////////////////////////////////////////// /// Initializes all member variables with default values. ///////////////////////////////////////////////////////////////////////// void Init (); /// The entity this user data class belongs to. TEntity m_Entity; /// The game global root entity. TEntity m_RootEntity; };
  8. Happy New Year all! Starts for me feeling dizzy
  9. These are all the supported keys, and the Pause key is N/A http://www.leadwerks.com/wiki/index.php?title=Image:Keyboard.jpg
  10. Books are fine, but sometimes i really like the STRG+F...no book can handle that
  11. For the speed...you may need to try it, depends on what you are doing i assume. AFAIK Lua will be the slowest, as it is an interpreter. In general C/C++ will be the fastest, but as LE is programmed in BlitzMax, i don't know if BlitzMax would be faster. Do you have any programming experience?
  12. Josh has just asked us the question what exactly we want DisableNewton (true); to do. Like he pointed out, disabling Newton would affect some parts of the engine. From my point of view he is in no way acting as if we are dumb Maybe you should read in between the lines, Tyler My 50 Cents to physX in LE: I'm neither a hate, nor a fanboy of any physics engine. I just see, that this "DisableNewton ()" command would cost Josh another week in which he can't fix bugs or add any documentation or new stuff. Masterxilo already implemented physX and shows us it works. IMO there i no need for a DisableNewton () command , anyone using physX will have a little overhead, but it will work. When your game is nearly finished and you need every bit of performance for the release, than pay him a few bucks to disable newton for you. That way everyone is happy and Josh can go on, careing for the more important things
  13. Go through the above points. When that doesn't work...well...
  14. No, these are not related to your issue. I also have these and it works nice here. Whats your graphics card? 1) Update graphics drivers 2) make a new, clean LE 2.3 install 3) no more ideas....
  15. Is it just that one level, or LE 2.3 in general? You should update your graphics drivers and add you specs to your signature
  16. Not as far as i know. Look at the water that comes with LE, there are about 30 dds textures that are used as an animation.
  17. The wii library actually works. Tried that out with DarkGDK some time ago. It's a matter of a few lines of code to get full access to a wii controller! #include "wiimote.h" wiimote MyWii; float fX = MyWii.Acceleration.X; http://wiiyourself.gl.tter.org/
  18. Ahh, i thought it maybe has something to do with the physics update or such Thanks Mack and Marley
  19. What does Stepmode actually do? The only place i have ever seen this is the oildrum.mat.
  20. The DrawTextA and DrawTextW are windows functions (or C++...). to make your command work, you need to cast the const char the c_str() returns into a char*. DrawText(0, 0, (char*)text.c_str());
  21. I also have this problem in C++. Looks like it's an Framewerk issue, when it works in BMax.
  22. In your video you can see the 3 shadow stages of the directional light. (these circles of popping up shadows). Try changing the light's range to something higher, like Marley suggested. If that doesn't work for you, you can set the distance for every shadow stage. Look up SetShadowDistance.
  23. Nice whisper So you are collecting engine keys with your application?
×
×
  • Create New...