Game Development Community

GMK and shadows

by Limdorn · in Game Mechanics Kit · 10/16/2011 (1:55 pm) · 1 replies

Hi .
I do it: GMK is working with physX 2.5.8 and all is fine but ...
is it posible to have shadows with physx objects (barrels,box,spheres...) that we use in gmk?
Thanks.

#1
02/16/2012 (4:16 am)
I had this problem a while ago! Just put these into ragdoll.cpp at the start of RagDollData::RagDollData() and also in physicsBody.cpp at the start of PhysicsBodyData::PhysicsBodyData()

shadowEnable = true;
shadowCanMove = true;
shadowCanAnimate = true;

genericShadowLevel = 0.4f;
noShadowLevel = 0.01f;

That Should give you shadows on physics objects and ragdolls. Because they are derived from shapebase this is all thats needed, and the shadow will render automatically!

Hope this helps!