Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames

ParticleSystems.SpringForce


00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
//=============================================================================
// $Author: Aleiby $
// $Date: 3/08/02 9:51a $
// $Revision: 3 $
//=============================================================================

//------------------------------------------------------------------------------
// Name:	SpringForce.uc
// Author:	Aaron R Leiby
// Date:	27 March 2000
//------------------------------------------------------------------------------
// Description:	Simple spring force to connect two particles.
//------------------------------------------------------------------------------
// How to use this class:
// + These should probably be used in conjunction with a dampening force 
//   (FrictionForce) too keep things from getting too wild.
//------------------------------------------------------------------------------

// Fix ARL: Springs should be evaluated after SlipForces.  But we can't do that
// because currently we are velocity based and need to be evaluated before 
// the LocatorForce -- otherwise we'll never affect the particles' locations
// until the next tick.  SlipForces need to be evaluated after the LocatorForce
// because their main purpose is to fix the "mistakes" that the locator force
// makes (thus keeping the particle positions correctly relative to each other).
//
// Solution: Make a spring force that replaces the locator force, and correctly
// takes occilation into account based on the current velocity.

class SpringForce extends Force
	native;

var() public    float			Stiffness;				// Spring constant. (Larger values == stiffer spring)
var() public    float			SpringLength;			// Automatically set by SetEndpoint, 
														// but may also be set manually.
var() native	ParticleHandle	ParticleA, ParticleB;	// Affected particles.

var const private int			StiffnessPtr;			// Reference to a master spring constant -- only used if set.

//------------------------------------------------------------------------------
// Note: Spring length is automatically calculated when you call this funciton
// based upon the particle's existing relative locations.
//------------------------------------------------------------------------------
public native simulated function SetEndpoints( ParticleHandle A, ParticleHandle B );

defaultproperties
{
	Stiffness=0.333333
	SpringLength=64.000000
	Priority=30.000000
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: sk 3-1-2016 10:38:40.000 - Creation time: sk 3-1-2016 10:48:41.831 - Created with UnCodeX