GSC reference › Built-in
ATan()
Built-in (engine)
Server + client
Math
Returns an angle corresponding to a particular tangential value
Signature
ATan(<tan value>)
Parameters
| Name | Required? | Details |
|---|---|---|
| tan value | Required | A tangential value |
Example (from Treyarch's docs)
upAngle = ATan( height/distance )
Real uses in BO3's scripts
Called 10 times in the decompiled scripts. A few, zombies first:
- scripts/shared/abilities/gadgets/_gadget_heat_wave.csc, line 179
pitch_vals[1] = 90 - (atan(150 / (trace["fraction"] * 400))); - scripts/shared/abilities/gadgets/_gadget_heat_wave.csc, line 180
pitch_vals[2] = 90 - (atan(300 / (trace["fraction"] * 400))); - scripts/shared/dev_shared.gsc, line 132
angleside = 2 * (atan((disttoside * 0.8) / minimapheight)); - scripts/shared/math_shared.gsc, line 561
yaw = atan(vecx / vecy); - scripts/cp/doa/_doa_utility.gsc, line 1606
yaw = atan(n_slope);
Related built-ins
- DistanceSquared()Returns the squared distance between two points - this is cheaper than the actual distance as it doesn't involve a square root
- Distance2DSquared()Returns the squared distance between two points, ignores height difference.
- Distance()Returns the distance between two points
- Distance2D()Returns the distance between two points, ignores height difference.
- Tan()Returns the tan of an angle
- MapShaderConstant()Maps a shader constant to an index.
- SetAnim()Restart": These functions cause the animation to restart.
- SetFilterPassConstant()Sets the filter pass constant
- GetAnimLength()Gets the length of an animation
- GetStance()Gets the stance of the player.
- ASMSetAnimationRate()Change the delta animation rate for the entity using ASM.
- SetAngularVelocity()Sets the angular velocity of a vehicle in degs/s.
New to GSC?
Start with the basics, or paste a compile error to get the fix.
Built-in descriptions, parameters and examples come from Treyarch's BO3 mod tools docs. Usage links point at shiversoftdev/t7-source (decompiled BO3 scripts).