Jump to content

Strange AddForce behaviour.


AggrorJorn
 Share

Recommended Posts

I have this sphere in my scene that I want to move using forces. However, as soon as I apply the following:

model->AddForce(speed * Time::GetSpeed(),0,0);

the gravity of this object is almost reduced to 0 velocity.

 

Also, when trying to add a force to implement jumping, the sphere looks more like it is being positioned rather than and actual force is being applied. The jumping code is only activated when space is pressed and looks similair to the movement like above with the movement:

model->AddForce(0, jumpForce * Time::GetSpeed(),0);

 

This is the code of creating the sphere:

//Create a sphere
model = Model::Sphere(16);
model->SetPosition(0,4,0);
model->SetMass(1);
//Create a shape
shape = Shape::Sphere(0,0,0,0,0,0,1,1,1);
model->SetShape(shape);
shape->Release();

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...