About Store Forum Documentation Contact



Post Reply 
Get Physic
Author Message
siwykon Offline
Member

Post: #1
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
Find all posts by this user Quote this message in a reply
Truelegend Offline
Member

Post: #2
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
Find all posts by this user Quote this message in a reply
Driklyn Offline
Member

Post: #3
RE: Get Physic
Code:
Players[0].ctrl.actor.ray(false);
// ray test
Players[0].ctrl.actor.ray(true);
04-19-2011 08:25 AM
Find all posts by this user Quote this message in a reply
siwykon Offline
Member

Post: #4
RE: Get Physic
Thanks Driklyn! It work.
04-20-2011 04:17 AM
Find all posts by this user Quote this message in a reply
Post Reply