Announcement

Collapse
No announcement yet.

RB Constraint Linear movement

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    RB Constraint Linear movement

    How can you stop and/or limit movement of a KActor using an RBConstraint?

    What I mean by limit movement is a way to specify bounds in which the KActor cannot move past. If the KActor reaches these bounds, all movement should stop immediately.

    I'm using the PhysicsGun with a KActor constrained to a HingeActor that can only move on the Y-axis, and I want to constrain this KActor not to past Y=128 units.

    Thanks!

    #2
    Ok well I found out that you can restrain movement within a radius by setting bLimit to 1 and LimitSize to a number. The affected KActor won't move out of this radius. However, I don't want the KActor to be able to move forward/backward in its starting place, but only forward to the LimitSize number and then be able to go backwards to its starting position. I hope that made sense..

    I look at the RB_ConstraintSetup.uc and found where it's assigning the LimitSize numbers. It says it can be shifted by "fiddling Pos1/2". I have no idea what this means.
    Code:
    struct native LinearDOFSetup
    {
    	/** Whether this DOF has any limit on it. */
    	var() byte			bLimited;
    
    	/** 
    	 *	'Half-length' of limit gap. Can shift it by fiddling Pos1/2.
    	 *	A size of 0.0 results in 'locking' the linear DOF.
    	 */
    	var() float			LimitSize; 
    
    	structdefaultproperties
    	{
    		bLimited=1
    		LimitSize=0.0
    	}
    };
    I found Pos1/2 in the defaultproperties:
    Code:
    defaultproperties
    {
    	Pos1=(X=0,Y=0,Z=0)
    	PriAxis1=(X=1,Y=0,Z=0)
    	SecAxis1=(X=0,Y=1,Z=0)
    
    	Pos2=(X=0,Y=0,Z=0)
    	PriAxis2=(X=1,Y=0,Z=0)
    	SecAxis2=(X=0,Y=1,Z=0)
    
    	LinearBreakThreshold=300.0
    	AngularBreakThreshold=500.0
    	
    	PulleyRatio=1.0
    }
    But any value I put in for them has no effect on the LimitSize radius.

    A picture since this is kinda hard to explain.


    I only want LimitSize to go in one direction, not in both.

    Thanks.

    Comment

    Working...
    X