x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Physx Constraints Motor nor doing anything C++

Hey!

I am having real trouble implementing constraints in C++ since there is absolutely no documentation on how to setup things correctly, there is not even one code-example out there, only Ramas Wiki article on how to set basic values.

My target is to create the principal of a self-closing door. When something opened the door, it will close automatically. Or more abstract: I need a way to say the constraint to rotate the constrainted object.

But I have no success in implementing it. The constraint itself now works and reacts properly to external forces, but all the motors don't have any effect on them.

The movement:

     this->steerElement->getConstrainedComponent()->SetAngularVelocityDrive(true, true);
     this->steerElement->getConstrainedComponent()->SetAngularDriveParams(50000, 100, 100000);
     this->steerElement->getConstrainedComponent()->SetAngularVelocityTarget(rot.Vector() * 50);

Settings: Linear Axis all locked. Angular axis all limited, Twist locked.

Breaking the constraint in code does work, so I have the right pointer there, also my values I pass get updated (they show up correctly in the editor when I select the constraint when I eject from the game), but it doesn't move a single millimeter. I tried tons of settings but I not once succeeded in just moving it one idea of a centimeter...

Am I missing something? I tried everything, enable linear axis, linear motor, everything...

I would really appreciate some help. Thanks :)

Product Version: UE 4.9
Tags:
more ▼

asked Oct 07 '15 at 09:21 PM in C++ Programming

avatar image

MykonCodes
96 8 15 25

(comments are locked)
10|2000 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question