Search Home Members Contacts
About Us
Products
Downloads
Community
Support
Pages: [1]
  Print  
Author Topic: For a man move by physics engine.  (Read 495 times)
nico2008
Community Member
*
Posts: 42


« on: July 28, 2011, 09:42:03 AM »

I have  a serious problem that:
I want to use TVPhysics.SetBodyLinearVelocity() to make actor move forward,But the angle would change in the same time.
And when the angle is changing,I cant get the right direction for moving..Help me.Thanks.
That is my code:
angle=TVP.GetBodyRotation(body).y
TVP.SetBodyPosition(body,x+10*Cos(angle),y,z+10*Sin(angle))
How to make the body move forward?
Logged
TripleView
Community Member
*
Posts: 32


« Reply #1 on: July 28, 2011, 04:45:47 PM »

With MESH.GetPosition
Physics.SetBodyPosition PHYSICID, 0, Land.GetHeight(.x, .z) + 15, 10
End With

Use that after you initialize the physic engine.

MESH.SetPosition Physics.GetBodyPosition(PHYSICID).x, Physics.GetBodyPosition(PHYSICID).y, Physics.GetBodyPosition(PHYSICID).z
MESH.SetRotation Physics.GetBodyRotation(PHYSICID).x, Physics.GetBodyRotation(
PHYSICID).y, Physics.GetBodyRotation(PHYSICID).z

Something like that should make the mesh and the physic body right, just use the above code where you update the scene.

http://www.youtube.com/watch?v=dtRR-goiik4&feature=player_profilepage
^^ not sure where the code for that is anymore though or I would have something better for ya.
Logged
nico2008
Community Member
*
Posts: 42


« Reply #2 on: July 29, 2011, 12:53:00 AM »

To be honest.I have not understand u.plz let me understand it, thanks
Logged
nico2008
Community Member
*
Posts: 42


« Reply #3 on: July 29, 2011, 12:57:09 AM »

My goal is to make a man move in the scence,and he can collide with other thing like a box,The collision will be run by physics engine not by me to program.You know my mean?
I want to use physics engine in my game,but there is a problem.help.Thanks.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.3 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks