Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark Physics & Dark A.I. & Dark Dynamix / copy rigid body speed, momentum, rotation... to another one

Author
Message
Master Xilo
17
Years of Service
User Offline
Joined: 8th Sep 2006
Location: Bern, Switzerland
Posted: 14th Jan 2008 18:59
How would I
copy a rigid bodys speed, momentum, rotation... to another one?
(so it does exactly the same)

I have to do this because i have to recreate a rigid body and delete the original, but give the new one the same vars.

With many "phy get"'s I think, but how would I apply them and wich ones do I need?

ty

-MX
Kendor
21
Years of Service
User Offline
Joined: 31st Jan 2003
Location: Malta
Posted: 14th Jan 2008 19:42

Object position x/y/z
Object angle x/y/z
phy get rigid body linear velocity x/y/z
phy get rigid body angular velocity x/y/z


These four commands should be all you need. To apply back to the new object, change the get to set.

Theory is when you know something, but it doesn't work. Practice is when something works, but you don't know why.
Programmers combine theory and practice: Nothing works and they don't know why.
Master Xilo
17
Years of Service
User Offline
Joined: 8th Sep 2006
Location: Bern, Switzerland
Posted: 14th Jan 2008 20:10
thank you much
kaedroho
16
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 14th Jan 2008 20:24 Edited at: 14th Jan 2008 20:25
if youre using the new update that wouldnt be possible because phy set rigid body angular velocity now clears the linear velocity. please dont ask why, im trying to find that out right now.
Kendor
21
Years of Service
User Offline
Joined: 31st Jan 2003
Location: Malta
Posted: 14th Jan 2008 20:30 Edited at: 14th Jan 2008 20:30
It's phy set rigid body rotation that clears the forces not phy set rigid body angular velocity. So if you first rotate and then apply the linear and angular velocity, it works correctly.

Theory is when you know something, but it doesn't work. Practice is when something works, but you don't know why.
Programmers combine theory and practice: Nothing works and they don't know why.
kaedroho
16
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 14th Jan 2008 20:31 Edited at: 14th Jan 2008 20:32
i know it says that, but angular velocity doesnt work neither
im downgrading right now to solve this
Kendor
21
Years of Service
User Offline
Joined: 31st Jan 2003
Location: Malta
Posted: 14th Jan 2008 20:44 Edited at: 14th Jan 2008 20:46
Here's an example:



Theory is when you know something, but it doesn't work. Practice is when something works, but you don't know why.
Programmers combine theory and practice: Nothing works and they don't know why.
Master Xilo
17
Years of Service
User Offline
Joined: 8th Sep 2006
Location: Bern, Switzerland
Posted: 14th Jan 2008 20:44
i works for me...

lvx#=phy get rigid body linear velocity x(res):lvy#=phy get rigid body linear velocity y(res):lvz#=phy get rigid body linear velocity z(res)

avx#=phy get rigid body angular velocity x(res):avy#=phy get rigid body angular velocity y(res):avz#=phy get rigid body angular velocity z(res)


and then

phy set rigid body linear velocity res,lvx#,lvy#,lvz#
phy set rigid body angular velocity res,avx#,avy#,avz#
kaedroho
16
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 14th Jan 2008 20:47 Edited at: 14th Jan 2008 20:47
well theres something wrong with my dark physics then, or im competely stupid.

Login to post a reply

Server time is: 2024-05-19 23:11:42
Your offset time is: 2024-05-19 23:11:42