e2 docs angle - wiremod/wire GitHub Wiki

Jump to table of contents

Angle

Angle = ang()

Same as ang(0,0,0) (1 ops)

Angle = ang(Number Rv1)

Makes an angle (2 ops)

Angle = ang(Number Rv1, Number Rv2, Number Rv3)

Makes an angle (2 ops)

Angle = ang(Vector Rv1)

Changes a vector variable into an angle variable. XYZ become PYR respectively (2 ops)

Angle = angnorm(Angle Rv1)

Gets the normalized angle of an angle (5 ops)

Number = angnorm(Number Rv1)

Gets the normalized angle of a number (5 ops)

Number = Angle:pitch()

Gets the pitch of the angle (1 ops)

Number = Angle:yaw()

Gets the yaw of the angle (1 ops)

Number = Angle:roll()

Gets the roll of the angle (1 ops)

Angle = Angle:setPitch(Number Rv2)

Returns a copy of the angle with Pitch replaced (use as Ang = Ang:setPitch(...)) (2 ops)

Angle = Angle:setYaw(Number Rv2)

Returns a copy of the angle with Yaw replaced (use as Ang = Ang:setYaw(...)) (2 ops)

Angle = Angle:setRoll(Number Rv2)

Returns a copy of the angle with Roll replaced (use as Ang = Ang:setRoll(...)) (2 ops)

Angle = round(Angle Rv1)

Rounds PYR to the nearest integer (5 ops)

Angle = round(Angle Rv1, Number Decimals)

Rounds PYR to argument 2's decimal precision (5 ops)

Angle = ceil(Angle Rv1)

Rounds PYR up to the nearest integer (5 ops)

Angle = ceil(Angle Rv1, Number Decimals)

Rounds PYR up to argument 2's decimal precision (5 ops)

Angle = floor(Angle Rv1)

Rounds PYR down to the nearest integer (5 ops)

Angle = floor(Angle Rv1, Number Decimals)

Rounds PYR down to argument 2's decimal precision (5 ops)

Angle = mod(Angle Rv1, Number Rv2)

Returns the remainder after PYR have been divided by argument 2 (5 ops)

Angle = mod(Angle Rv1, Angle Rv2)

Returns the remainder after the components of angle 1 have been divided by the components of angle 2 (5 ops)

Angle = clamp(Angle Rv1, Number Rv2, Number Rv3)

Clamps angle 1's PYR between argument 2(min) and argument 3(max) (5 ops)

Angle = clamp(Angle Rv1, Angle Rv2, Angle Rv3)

Clamps angle 1's PYR between the PYR of angle 2(min) and angle 3(max) (5 ops)

Angle = mix(Angle Rv1, Angle Rv2, Number Rv3)

Combines angle 1's PYR with angle 2's PYR by a proportion given by argument 3 (between 0 and 1) (5 ops)

Angle = shiftR(Angle Rv1)

Shifts the angle's components right: shiftR( p,y,r ) = ( r,p,y ) (2 ops)

Angle = shiftL(Angle Rv1)

Shifts the angle's components left: shiftL( p,y,r ) = ( y,r,p ) (2 ops)

Number = inrange(Angle Rv1, Angle Rv2, Angle Rv3)

Returns 1 if each component of A is between (or is equal to) the components of Amin and Amax (5 ops)

Angle = Angle:rotateAroundAxis(Vector Axis, Number Degrees)

Returns the angle A rotated around vector V by N degrees (5 ops)

Angle = toRad(Angle Rv1)

Converts the angle's magnitude from radians to radians (5 ops)

Angle = toDeg(Angle Rv1)

Converts the angle's magnitude from radians to degrees (5 ops)

Vector = Angle:forward()

Gets the forward vector of the angle (5 ops)

Vector = Angle:right()

Gets the right vector of the angle (5 ops)

Vector = Angle:up()

Gets the up vector of the angle (5 ops)

String = toString(Angle A)

Gets the angle nicely formatted as a string "[P,Y,R]" (5 ops)

String = Angle:toString()

Gets the angle nicely formatted as a string "[P,Y,R]" (5 ops)