CC3UniformlyRotatingParticleProtocol Protocol Reference
Conforms to | CC3ParticleProtocol |
Declared in | CC3ParticleSamples.h |
Overview
CC3UniformlyRotatingParticleProtocol defines behaviour required for particles that are configured to rotate at a constant rate.
Rotation velocity can be specified in terms of Euler angles or rotation of an angle around a defined axis. These rotational velocity properties are mutually exclusive, and if more than one of these properties have been set, the value and type of rotation of the most recently specified property is used to rotate the particle.
This protocol can be used with mesh particles. Point particles cannot be rotated.
Tasks
-
rotation
property required method -
rotationVelocity
property required method -
rotationAxis
property required method -
rotationAngle
property required method -
rotationAngleVelocity
property required method
Properties
rotation
The current rotational orientation of the particle in 3D space, relative to the emitter.
@property (nonatomic, assign) CC3Vector rotation
Discussion
This value contains three Euler angles, defining a rotation of this particle around the X, Y and Z axes. Each angle is specified in degrees.
Rotation is performed in Y-X-Z order, which is the OpenGL default. Depending on the nature of the particle you are trying to control, you can think of this order as yaw, then pitch, then roll, or heading, then inclination, then tilt,
When setting this value, each component is converted to modulo +/-360 degrees.
Rotational transformation can also be specified using the rotationAxis and rotationAngle properties. Subsequently, this property can be read to return the corresponding Euler angles.
Declared In
CC3ParticleSamples.h
rotationAngle
The current angular rotation around the axis specified in the rotationAxis property.
@property (nonatomic, assign) GLfloat rotationAngle
Discussion
When setting this value, it is converted to modulo +/-360 degrees. When reading this value after making changes using rotateByAngle:aroundAxis:, or using another rotation property, the value of this property will be clamped to +/-180 degrees.
For example, if current rotation is 170 degrees around the rotationAxis, invoking the rotateByAngle:aroundAxis: method using the same rotation axis and 20 degrees, reading this property will return -170 degrees, not 190 degrees.
Rotational transformation can also be specified using the rotation property (Euler angles). Subsequently, this property can be read to return the corresponding angle of rotation.
Declared In
CC3ParticleSamples.h
rotationAngleVelocity
The rate that this particle changes rotation, around the axis specified in the rotationAxis property, specified in degrees per second. This value may be either positive or negative, to indicate the direction of rotation.
@property (nonatomic, assign) GLfloat rotationAngleVelocity
Declared In
CC3ParticleSamples.h
rotationAxis
The axis of rotation of the particle in 3D space, relative to the emitter, expressed as a directional vector. This axis can be used in conjunction with the rotationAngle property to describe the rotation as a single angular rotation around an arbitrary axis.
@property (nonatomic, assign) CC3Vector rotationAxis
Discussion
Under the identity rotation (no rotation), the rotationAngle is zero and the rotationAxis is undefined. Under that condition, this property will return the zero vector kCC3VectorZero.
Rotational transformation can also be specified using the rotation property (Euler angles). Subsequently, this property can be read to return the corresponding axis of rotation.
Declared In
CC3ParticleSamples.h
rotationVelocity
The rate that this particle changes rotation, specified as three Euler angles in degrees per second. Each component Euler angle may be either positive or negative, to indicate the direction of rotation.
@property (nonatomic, assign) CC3Vector rotationVelocity
Declared In
CC3ParticleSamples.h