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 / Dark Physics: Simple, in theory: odd, in practice

Author
Message
C0wbox
17
Years of Service
User Offline
Joined: 6th Jun 2006
Location: 0,50,-150
Posted: 1st Mar 2008 16:22 Edited at: 1st Mar 2008 18:38
<Cuts all the boring prologue of what I'm doing.>

I basically want to be able to do:

in Dark Physics.

So far I have

But getting it to move in a direction in relation to the Y angle seems impossible; you only seem to be able to move stuff in Dark Physics through 1 of the axise: X, Y or Z.

Consequently my code looks like:


But won't work.

What should I be doing?

(The WIP this question is linked too is Vision.)

Airslide
19
Years of Service
User Offline
Joined: 18th Oct 2004
Location: California
Posted: 1st Mar 2008 19:07
I remember reading a thing, I think it was for Newton, that explained the concept of physics in a virtual simulation. I'll try to sum it up: When using a physics engine you give up your control over objects and give it to the physics engine. Move object and position object are no longer useable on a normal rigid body.

If you want to move a rigid body, look at the commands for adding force or velocity. Optionally you can make it a kematic (spelling? bleck) object which you have more direct control over.

Note that if you are dealing with a character it may be better to use a character controller, and while they have certain limitations they are pretty useful if used correctly.

C0wbox
17
Years of Service
User Offline
Joined: 6th Jun 2006
Location: 0,50,-150
Posted: 1st Mar 2008 20:15
Well I've been looking at the commands for Dark Physics and didn't really see a way to get the result I wanted.

Basically the player is moved in a forward/backward/left/right format, with the camera angle (3rd person) controling the angle they are performed at. (So basically it is only forward/backward/left/right in relation to which way the camera is facing.)

How exactly would I do this in Dark Physics?

jason p sage
16
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 1st Mar 2008 20:15
Position Object, Add To Physics... from then on you can't do MOVE OBJECT with success.

You can position it - but use dbPhyPositionRididBody(ID,x,y,z) for example.

You can add forces to more than one axis also... just read the VALUES FIRST, then Set them.... dbPhyGetRigidBodyAngleVelocityX(ID) or something similar to read velocities, forces etc.

You MAY (you must) ask for the OBJECT's POSITION and ORIENTATION ANGLE the old way: MyX = OBJECT POSITION X(ID)

C0wbox
17
Years of Service
User Offline
Joined: 6th Jun 2006
Location: 0,50,-150
Posted: 1st Mar 2008 20:42 Edited at: 1st Mar 2008 20:43
No no no; I'm not trying to forcefully rotate the object using physics, I just want it to rotate to "an angle" when I use a command/function/gosub.-(Whatever it takes.)

And anyway, I've done that part. I now want it to move "forward", "backwards", "left" or "right" in relation to this angle I've got it rotated to. (Not forwards/backwards/left/right in relation to the world's axise.)

jason p sage
16
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 1st Mar 2008 20:53
Then position it and rotate it before you add it to physics engine.

If you wish to be able to have full control - then use either a controller or forget physics I suppose?

Codger
21
Years of Service
User Offline
Joined: 23rd Nov 2002
Location:
Posted: 1st Mar 2008 21:05
If you want full control make it a kinematic object, dynamic objects are intended to be moved by applying forces.

For example you place a football on the corner at this point it should be regular object before you you kick it make it a dynamic object forces.
If you want a turret on a tank to move you make it a kinematic object and rotate it to the exact position you desire. A shell would be a dynamic object and thrust forward by forces. To reuse the shell delete the dynamic object then move the shell back into the barrel

System
PIV 2.8 MZ 512 Mem
FX 5600 256 mem
C0wbox
17
Years of Service
User Offline
Joined: 6th Jun 2006
Location: 0,50,-150
Posted: 1st Mar 2008 21:59 Edited at: 1st Mar 2008 22:33
Ok, I see what you are saying. So what is the command to rotate a kinematic object to an angle?

And also, once I set this angle, how to I move it "forwards", for example?

EDIT:
Oh I see. Do I use a dumy object and just have the kinematic object positioned at it?

EDIT2:
Ok people, thanks for the help, it put me on the right path. I've now achieved what I need to.

sindore
19
Years of Service
User Offline
Joined: 2nd Jul 2004
Location: Bedfordshire, UK
Posted: 2nd Mar 2008 11:07
Iv put out a challenge to any one who is interested,
her is the link

http://forum.thegamecreators.com/?m=forum_view&t=124954&b=30

I hope you come and have a go, If you've got the man lumps

From the dark and in to the light, twisted the body of madness, dark souls to only the one who would be called, Death lord of the dead, king of the forgotten, keep of lost souls.
sindore
19
Years of Service
User Offline
Joined: 2nd Jul 2004
Location: Bedfordshire, UK
Posted: 11th Mar 2008 07:39
sorry about the spam, wont do it again

From the dark and in to the light, twisted the body of madness, dark souls to only the one who would be called, Death lord of the dead, king of the forgotten, keep of lost souls.

Login to post a reply

Server time is: 2024-05-08 17:53:07
Your offset time is: 2024-05-08 17:53:07