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 GDK / please Help: Warp Function

Author
Message
Poof Master
14
Years of Service
User Offline
Joined: 14th Jan 2010
Location:
Posted: 17th Feb 2010 23:29
Okay so I need to make a warp function which basically takes the player to the position of the mouse. The problem is I am using Box2d so my sprite is pasted to the position of the physics box. now I have tried a number of different things and have really boiled it down to one problem.

Here's the code before I go into it:


Now when I watch the values Position.x after I hit the left click they are all equal to the mouse position.
So I looked into this function:


and in the GetPosition() (which is a box2d function) it looks like this


So basically m_xf is the value that I need to change because when I watch the value of it, it never changes. So how do I change the value in the box2d function? Or am I just thinking about this in the wrong way?

Sorry for the long post. It was the only way I could explain my problem.
Amnzero
15
Years of Service
User Offline
Joined: 1st Aug 2009
Location:
Posted: 18th Feb 2010 11:58 Edited at: 18th Feb 2010 12:03
The value of m_xf is an object, or structure of some kind...

Is there not a SetPosition, or Move function in box2d? Just changing the member variables of the vector ref that is returned by GetPosition does not mean that the "actual" position of the m_xf object will be changed.

[url="http://neovance.com/"][/url]

Login to post a reply

Server time is: 2024-10-02 01:21:19
Your offset time is: 2024-10-02 01:21:19