Class motion.Acceleration
Extends
motion.Motion.
A controller for applying accelerations to an object.
Defined in: motion.em.
Constructor Attributes | Constructor Name and Description |
---|---|
motion.Acceleration(presence, accelFn, period)
|
- Fields borrowed from class motion.Motion:
- presence
- Methods borrowed from class motion.Motion:
- isSuspended, reset, suspend
Class Detail
motion.Acceleration(presence, accelFn, period)
- Parameters:
- {presence} presence
- The presence to control
- {function(presence)->(util.Vec3|undefined)} accelFn
- (optional =get from presence.accel field) A function that should return the acceleration on a presence at any point in time. If accelFn returns undefined ("return;"), the acceleration will be unchanged from the last call. If accelFn itself is undefined (or not provided), the controller will use the value of presence.accel.
- {number} period
- (optional =defaultPeriod) The period at which the acceleration is updated