Please take a look here:
http://www.youtube.com/watch?v=hpUEgGtllng
As you can see the character controller cannot stay onto the platform.
I read in the manual:
"There are a few issues to be aware of:
if a dynamic actor is squished between a kinematic and a static or two kinematics, then it will have no choice but to get pressed into one of them, in future versions we may make it possible to have the kinematic motion be blocked in this case
kinematic actors will only collide with true dynamic actors, but not with static actors, this may also change in the future ?"
What should be the type of object for a platform? I thought that the DarkPhysics could take care of all hard jobs to avoid the issue above.
I tried to create the platform as a dynamic rigid mesh but for reasons only TGC knows nothing happens (it is not affected by the gravity).
#include <DarkGDK.h>
#include <DarkPhysics.h>
int nGround = 1;
int nPlatform = 3;
const float fPhyFixedTiming = 1.0/60.0;
void DarkGDK (void)
{
dbPhyStart();
dbPhySetFixedTiming(fPhyFixedTiming);
dbPhyUpdate(0);
dbSyncOn();
dbSyncRate(60);
dbLoadObject("../media/ground01.3ds", nGround);
dbPhyMakeRigidBodyStaticMesh(nGround);
dbLoadObject("../media/platform.x", nPlatform);
dbPositionObject(nPlatform, -10.0, 20.0, 18.0);
dbPhyMakeRigidBodyDynamicMesh(nPlatform);
dbPositionCamera(-10.0, 10.0, -25.0);
while ( LoopGDK() )
{
dbPhyUpdate(1);
dbPhyUpdate(0);
dbSync();
}
dbDeleteObject(nGround);
dbDeleteObject(nPlatform);
dbPhyClear();
return;
}
Then i tried to make the dynamic mesh a kinematic actor:
#include <DarkGDK.h>
#include <DarkPhysics.h>
int nGround = 1;
int nPlatform = 3;
const float fPhyFixedTiming = 1.0/60.0;
void DarkGDK (void)
{
dbPhyStart();
dbPhySetFixedTiming(fPhyFixedTiming);
dbPhyUpdate(0);
dbSyncOn();
dbSyncRate(60);
dbLoadObject("../media/ground01.3ds", nGround);
dbPhyMakeRigidBodyStaticMesh(nGround);
dbLoadObject("../media/platform.x", nPlatform);
dbPositionObject(nPlatform, -10.0, 20.0, 18.0);
dbPhyMakeRigidBodyDynamicMesh(nPlatform);
dbPhySetRigidBodyKinematic(nPlatform, true);
dbPositionCamera(-10.0, 10.0, -25.0);
float x=dbObjectPositionX(nPlatform), y=dbObjectPositionY(nPlatform), z=dbObjectPositionZ(nPlatform);
while ( LoopGDK() )
{
y += 10.0;
dbPhySetRigidBodyKinematicPosition(nPlatform, x, y, z);
dbPhyUpdate(1);
dbPhyUpdate(0);
dbSync();
}
dbDeleteObject(nGround);
dbDeleteObject(nPlatform);
dbPhyClear();
return;
}
but nothing happened.
Do you believe, you guys in the TGC, that someone could really produce a serious project with DarkPhysics which is full of bugs and has the worst documentation a programmer could ever read?
Is your target some bucks only?