Physics Simulation Forum

 All times are UTC

 Page 1 of 1 [ 4 posts ]
 Print view Previous topic | Next topic
Author Message
 Post subject: Vector3 QuestionPosted: Tue Jan 22, 2008 7:54 pm

Joined: Wed Jan 16, 2008 10:48 pm
Posts: 4
Hello, on mouse move I am calculating the old mouse position vector3 and the new mouse position vector3. I want to then take those two values and get a new Vector3 of where the object should go based upon those two values. I am currently using the Vector3.Add method but that is clearly the wrong approach. Can anyone help? Thanks in advance!

Top

 Post subject: Re: Vector3 QuestionPosted: Wed Jan 23, 2008 12:48 am

Joined: Wed Jan 16, 2008 10:48 pm
Posts: 4
I am trying this in a PhysicsWorld with gravity on Z:

Vector3 newVector3Pos = pp.Pos2DToPos3D((int)newMousePos.X, (int)newMousePos.Y);
newVector3Pos.Normalize();
newVector3Pos *= 7.0f;
Vector3 relPos = newVector3Pos - pb.Body.CenterOfMassPosition;
relPos.Normalize();

pb.Body.ApplyImpulse(newVector3Pos, relPos);

the results are funky but it is moving. Not in the direction my mouse is moving. Any help would be greatly appreciated as I am REALLY NEW to Bullet. Thanks!

Top

 Post subject: Re: Vector3 QuestionPosted: Wed Jan 23, 2008 1:06 am

Joined: Sun Jun 26, 2005 6:43 pm
Posts: 3744
Location: California, USA
Is this really Bullet C++ version?

It looks more like a port or other physics engine. Where is this 'Pos2DToPos3D' method implemented?

Thanks,
Erwin

Top

 Post subject: Re: Vector3 QuestionPosted: Wed Jan 23, 2008 6:43 pm

Joined: Wed Jan 16, 2008 10:48 pm
Posts: 4
Good point, I should have mentioned, this is the C# port and Pos2dToPos3D is just the ReyTo method refactored. So it just takes a point and returns a point in 3D space, if I am correct.

Top

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 1 of 1 [ 4 posts ]

 All times are UTC

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 4 guests

 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum

Search for:
 Jump to:  Select a forum ------------------ BULLET PHYSICS LIBRARY USERS    General Bullet Physics Support and Feedback    Release Announcements    Applications, Games, Demos or Movies using Bullet PHYSICS AUTHORING TOOLS, SERIALIZATION AND STANDARDS    Physics authoring tools, serialization, standards and related topics RESEARCH AND DEVELOPMENT IN COLLISION DETECTION & PHYSICS. Don't post Bullet support questions here!    Research and development discussion about Collision Detection and Physics Simulation    Links, Papers, Libraries, Demos, Movies, Comparisons       Non-technical forum and license/patent discussion    Career Opportunities