About Store Forum Documentation Contact
Donations:
309$/mo



Post Reply 
Physics problem since latest update
Author Message
3DRaddict Offline
Member

Post: #1
Physics problem since latest update
I am now unable to translate any of my actors in the demo "Mouse Manipulation of Rigid Bodies" which I posted up a couple of months ago:
http://www.esenthel.com/community/showth...p?tid=7884

The code I've used to accomplish the translation is:

PHP Code:
actorMass=SelectedActor->mass();
            
Vec AddedForce
     
            
float ForceStrength=actorMass MOVE_STRENGTH
            
AddedForce = (RayOffsetLocation-ActorLocation);
            
SelectedActor->addForce(AddedForce*ForceStrength); 


However, there is no problem with rotation of a selected actor. It works exactly as before the update.

PHP Code:
Torque.0.0;
               
Torque.ROTATE_STRENGTH*actorMass;
               
Torque.0.0;
               
SelectedActor->addTorque(Torque); 

I have made no changes to the code prior to the latest update.

Referring to my demo: on selecting the actor with the mouse cursor, it refuses to budge in any direction when I move the mouse.

This problem is also present in the other examples where I use the mouse to manipulate the actor (e.g. Warping BeachBall)
(This post was last modified: 10-04-2014 08:20 AM by 3DRaddict.)
10-04-2014 08:08 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: Physics problem since latest update
Hello,

Last update had no changes to physics.

The problem must be somewhere else.

I've made a small test and Actor.addForce works ok.
10-04-2014 09:25 AM
Find all posts by this user Quote this message in a reply
3DRaddict Offline
Member

Post: #3
RE: Physics problem since latest update
Yes the physics is fine.
I've now got it working to my satisfaction.
The problem seemed to be a timing issue regarding the mouse cursor screen position.

Previous to the update I had to use the following code to keep the mouse cursor centered on the actor whilst it was being translated by the mouse movement:
PHP Code:
//Keep cursor image on hit centre of picked object
         
Vec2 screen=PosToScreen(ActorLocation); // convert world position to screen position
         
Ms.pos(screen); 

Now, after the update, by commenting this code out, everything operated correctly.
(i.e. the selected actor could be translated AND the cursor remained centralised on the
actor)

So... it would appear the increased speed of operations with the new update was the GOOD culprit!grin
10-04-2014 01:14 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply