siwykon
Member
|
Get Physic
How I can select Monster by physic?
I know it:
Vec pos, dir;
ScreenToPosDir(Ms.pos(), pos, dir);
PhysHit phys_hit;
if(Physics.ray(pos,pos+dir*D.viewRange(),&phys_hit))
{
if(phys_hit.obj)
{
if(Horse *horseSel=CAST(Horse, phys_hit.obj))
{
//Horse is selected: do something
}
}
}
But it work only when I have first person camera. How I can Select Horse by physic (or other way) in third person camera (how I can disable Players Physic selection?)
|
|
04-19-2011 04:37 AM |
|
Truelegend
Member
|
RE: Get Physic
I am not sure it will work but you can try .
Code:
MeshP()::Physics.stopSimulation();
for disable the Physics of your mesh.
|
|
04-19-2011 07:57 AM |
|
Driklyn
Member
|
RE: Get Physic
Code:
Players[0].ctrl.actor.ray(false);
// ray test
Players[0].ctrl.actor.ray(true);
|
|
04-19-2011 08:25 AM |
|
siwykon
Member
|
RE: Get Physic
Thanks Driklyn! It work.
|
|
04-20-2011 04:17 AM |
|