Link to home
Start Free TrialLog in
Avatar of codevomit
codevomit

asked on

Switching between PHYS_RigidBody to Phys_None and back again problem UDK

I get a weird anomaly when I try setting to phys_none, first the angle of the object changes, and when I switch back to phys_rigidbody the object goes crazy trying to set it's self back to the angle and location it was at before I switched to none.
Avatar of Member_2_5069294
Member_2_5069294

Describe the 'going crazy', how does the object behave?  Is the object intersecting anything when you set it back to rigid body?

I don't know about UDK itself, but I've done lots of work with rigid body physics.  I have a few ideas what this might be.  However there isn't enough information in your question for anything but speculation.

This is could be interpolation or energy conservation.  Physical bodies have kinetic energy, which pushes them in some direction and spins them.  When you make the object none physical, its stops moving with that energy, but the energy is not necessarily removed from the object.

Some physics system work with interpolation.  Physical motion happens continuously not 50 times per second like rendering.  The system might store where the object is and where its going to be in 0.5 seconds (unless something disturbs it), then interpolate closer to that point on each frame.

Then again, it may simply be that UDK keeps separate states for physical and non-physical objects.  Perhaps there is some code that tries to match them up when you switch state.  I guess the intention is that the object would move physically, then be frozen in place by making it non-physical.  So that when you make it physical again, it carries on from where it left off, rather than having moved somewhere else.
ASKER CERTIFIED SOLUTION
Avatar of codevomit
codevomit

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of codevomit

ASKER

I found my problem