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.

DarkBASIC Professional Discussion / I just want to give a position to a Newton object! :-y

Author
Message
Alduce
23
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 19th Oct 2012 15:42 Edited at: 19th Oct 2012 15:46
Hi dudes, I am trying to put some NEWTON objects over a matrix.
It\'s a simple mission but I have a problem..

Ok, I make 2 cube objects. Later I gave NEWTON rules to these cubes and I got no errors about.
The problem born when I try to give a XYZ position to each of these cubes BEFORE THE START OF THE MAIN LOOP (but the problem is the same if I try to move my Newton object inside the main loop).

Here the code(I leave the example remarks to make you look more easy).



Damn I think the logic is right.. so why my cubes remaining in standard initial position instead of taking my XYZ coords?

Thanks in advance!
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 19th Oct 2012 16:25 Edited at: 19th Oct 2012 16:25


Just making it more readable hopefully...

As far as it goes with Dark Physics... once you hand the object over to the physics engine you need to use it's built in commands to move the objects...

Hope that helps, so try finding a NEWTON command to position objects...[b]

Alduce
23
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 19th Oct 2012 17:36 Edited at: 19th Oct 2012 17:40
Mmm but I checked how the objects need to be moved from another Newton code example and is used the following command!:

Position object NDB_GetDBPro(cube1),140,5,140
Where cube1 is the Newton rigid body associate to the DBPro object 1..


So we shoud (theoretically) use the standard DBPro Position object command.
And from what I understand the "object number" parameter is given by the Newton NDB_GetDBPro command..

In other Newton example this works...


Probably the issue is related to the fact that the rigid body by now is inside the Newton physic rules.. but how I can "force" the movement?? (and my movement is different from a movement due to a Newton force that for example will push the body..)
Alduce
23
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 19th Oct 2012 18:11 Edited at: 19th Oct 2012 18:15
DONE!!

I need (as MrValentine said) a specify "command" to give a position to my cube!:



So you can notice that NDB_NewtonBodySetMatrix will give the NEWTON WORLD COORDS to the rigid body (the rigid body related to the DBPro cube!!)

Ps.
I think this temporary Newton matrix must be created ALWAYS before any movement or rotation.. I hope this just is not too heavy to handle for the compiling time...
James H
19
Years of Service
User Offline
Joined: 21st Apr 2007
Location: St Helens
Posted: 19th Oct 2012 18:18
Quote: "I think this temporary Newton matrix must be created ALWAYS before any movement or rotation.."

if you arent using the physics yes - ie resetting an object at say a spawn point, but its no good to try and force physics this way
Alduce
23
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 19th Oct 2012 18:22 Edited at: 19th Oct 2012 18:25
James H I don't understand well..

You mean that the movement should be made by newton forces and not by a spawn point like my example, right?

In fact I have to use this way just to give a start position. To move during game I will use Newton forces..
James H
19
Years of Service
User Offline
Joined: 21st Apr 2007
Location: St Helens
Posted: 20th Oct 2012 12:16
Quote: "In fact I have to use this way just to give a start position. To move during game I will use Newton forces.. "


Yes thats exactly what i meant - what you are doing perhaps i misunderstood you were doing it as intended, my apologies
Alduce
23
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 20th Oct 2012 12:44
Quote: "Yes thats exactly what i meant - what you are doing perhaps i misunderstood you were doing it as intended, my apologies "


haha nono you understand pretty well my point!
Unfortunately my english always make me in trouble when I read other users comments so I need to make many "compiling cycle" of reading before sufficiently well understand the right sense of your words!
James H
19
Years of Service
User Offline
Joined: 21st Apr 2007
Location: St Helens
Posted: 20th Oct 2012 13:09
haha yes, likewise i read your statement and think same hehehe ))

Login to post a reply

Server time is: 2026-07-07 17:31:16
Your offset time is: 2026-07-07 17:31:16