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.

Author
Message
Dark Fire
16
Years of Service
User Offline
Joined: 23rd Jun 2008
Location: In the code you write
Posted: 26th Jul 2008 10:58
What I am trying to do is create a gravity gun. To do that I would need a function that would move a rigid body to a point using velocity.

I have tried creating this function before, but it didn't move in a straight line.

I just used distance on the x coord. for velocity x and so on and so forth. (X, Y, Z)

I don't know much trig, so if someone can help me it would be great!


My Other question would be how to throw the object based off of where the camera was rotated.

Again, don't know much trig so any help would be awesome!

Thanks,

Dark Fire
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 26th Jul 2008 20:36
How about using force fields?

3700+ Athlon 64 - Geforce 7600 GS - 2GbDDR2 RAM - 40Gb Hdd (In this pc) - Windows Vista Ultimate (x86)
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 26th Jul 2008 21:03
yes, if might work with force fields, I made vortex demo and you can shape into a cone.

Dark Physics makes any hot drink go cold.
Dark Fire
16
Years of Service
User Offline
Joined: 23rd Jun 2008
Location: In the code you write
Posted: 26th Jul 2008 22:19
I don't want to use force fields because that is not the effect I want.

I only want to attract one object toward the camera + carry it around in front of the camera. Then launch that object forward.

Thanks for any help in advance!

Dark Fire
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 26th Jul 2008 23:04
I see this line might work .

phy set rigid body velocity id,0,3,10 it will fire in a straight line from point of view.

hope that helps or ask again, some might know what you want.

Dark Physics makes any hot drink go cold.
Dark Fire
16
Years of Service
User Offline
Joined: 23rd Jun 2008
Location: In the code you write
Posted: 27th Jul 2008 03:43
Ok, let me explain this a bit more.

You have the camera that moves around. You click on an object and get the ID of that object using pick object.

That object should move towards the camera as a Dark Physics Dynamic Object. Once it reaches the camera it will stop and be turned into a kinematic object.

Then it will always stay in front of the camera when you move around.

When you press the left mouse button again it will launch the object forward. (Depending on camera angle, position ect)

What I am asking:
How to create a function that would use velocity to move the object in streight line to the camera. (While the camera is moving it should readjust)
Also, how to launch the object using forces forward. (Keeping in mind that the camera angle may change)

Hope this makes it more clear.

Thanks for any help in advance!

Dark Fire
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 27th Jul 2008 12:00
There controlShooting() function that in the ragdoll shooting demo, shows how to fire an object at any camera angle might help.

would raycasting system work, as I have seen someone using it physX to find the object they were shooting at to place buttle marks on the object, so turn ti around.

when you've click on the object, you know which one it is, so now raycast to your camera object (my need a dummy one) then using curveangle make it get drawn to the camera.

so more like missile lock being fired from the enemy.

Dark Physics makes any hot drink go cold.
Jammy
21
Years of Service
User Offline
Joined: 15th Jan 2003
Location: Scotland
Posted: 27th Jul 2008 12:27
Thanks HowDo - I was looking for something like that controlshooting()- i had almost got it right, but not quite.

HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 27th Jul 2008 12:40 Edited at: 27th Jul 2008 12:46
Some of the demos have what we want its just finding it or seeing its there.


have a look at the movment demo you might be able to make that track and move the object.

Dark Physics makes any hot drink go cold.

Login to post a reply

Server time is: 2024-11-24 20:35:30
Your offset time is: 2024-11-24 20:35:30