DaDonik
-
Posts
376 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Posts posted by DaDonik
-
-
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
-
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; };
-
Happy New Year all!
Starts for me feeling dizzy
-
These are all the supported keys, and the Pause key is N/A
http://www.leadwerks.com/wiki/index.php?title=Image:Keyboard.jpg
-
Books are fine, but sometimes i really like the STRG+F...no book can handle that
-
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?
-
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
-
Go through the above points. When that doesn't work...well...
-
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....
-
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
-
Does LE support animated textures?
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.
-
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;
-
Ahh, i thought it maybe has something to do with the physics update or such
Thanks Mack and Marley
-
What does Stepmode actually do?
The only place i have ever seen this is the oildrum.mat.
-
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());
-
I also have this problem in C++.
Looks like it's an Framewerk issue, when it works in BMax.
-
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.
-
Nice whisper
So you are collecting engine keys with your application?
-
Let Vec3 be as it is. It's not a bad idea that every engine command starts capitalized.
-
No problem for me. As long as it works when writing 6 lines in c++, it's still like magic
-
It's working with Framewerk
All i had to add to my project was:
SetGlobalObject ("world_main", g_FW.GetMain ().GetWorld ());
SetGlobalObject ("world_transparency", g_FW.GetTransparency ().GetWorld ());
SetGlobalObject ("world_background", g_FW.GetBackground ().GetWorld ());
SetGlobalObject ("camera_main", g_FW.GetMain ().GetCamera ());
SetGlobalObject ("camera_transparency", g_FW.GetTransparency ().GetCamera ());
SetGlobalObject ("camera_background", g_FW.GetBackground ().GetCamera ());
g_FW is an instance of the Framewerk...obviously
Josh, you told us that LUA runs along with C++ with NO code changes...thats just not true!
I need the 6 lines above!!
-
My registration key seems to be broken...thats really sad =(
I emailed Josh and hopes he fixes it asap, when he is awake!
Controlling the player
in Programming
Posted
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.