Jump to content

UpVector


SpiderPig
 Share

Recommended Posts

Ah I see what you mean now.  I got it to work but the kinematic joint still gives me trouble where the object will drag across the ground and jitter.  I think the problem is, it drags and gets a new rotation, and then next frame the target rotation is set, causing a jitter between the two.  Is Joint::Vector() able to be moved at all?  I know it can be moved around if something hits it, but I want to add forces to it...

Link to comment
Share on other sites

I don't understand what behavior you are describing, but I think that only the character controller is appropriate for characters. If you try to do it with realistic physics there will always be some unwanted behavior caused by the forces used to keep the object upright.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Want I want is exactly what you have done with your character controller, but align to different gravity directions.  What I'm doing to try and achieve it is this;

  • Create Capsule Shape
  • Apply constant force of gravity
  • On Actor::Collision();
    • Store collision point and normal
    • Store collision time
    • Turn off gravity
    • Set Velocity to 0
  • On UserInput to move;
    • Create Plane with the normal and position
    • Use angle of character to find a point exactly 1 unit away
    • Intersect the plane with a ray aligned with gravity at that move point
  • Move capsule with SetVelocity() or PhysicsSetPosition()
  • In Actor::UpdateWorld();
    • Use PhysicsSetRotation() to align the capsule with gravity
    • Speed = GetVelocity().Length()
    • If speed is not 0 and the collision time is greater than 100ms ago, enable gravity.

Using a kinematic joint has the same problems as above but with the addition of slowly rotating to align with gravity and not being snappy when moving to the target unless mass is really really low.

I've also tried, setting the collision response off for the capsule and finding all entities in the AABB around the capsule, and ray casting each shape to find the collision point.  This work smoothly and was great except FPS dropped from 100 to 70 (just with one Pick per frame as it was moving) so this was not ideal.  The fact that this worked told me that the problem lies with the capsule still colliding with the ground as I move it.

 

I think what I want can only be done under the hood with newton commands.

 

 

 

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...