/// <summary> /// @brief Multiply the vector by the transform assuming that w=0. /// This function will multiply the given vector by the given transform such that translation will /// not affect the vector. /// @param transform A transform. /// @param vector A vector. /// @return The transformed vector. /// @ingroup Matrices) /// /// </summary> public Point3F MatrixMulVector(TransformF transform, Point3F vector){ return new Point3F ( m_ts.fn_MatrixMulVector(transform.AsString(), vector.AsString())); }
/// <summary> /// @brief Applies a radial impulse to the object using the given origin and force. /// /// @param origin World point of origin of the radial impulse. /// @param radius The radius of the impulse area. /// @param magnitude The strength of the impulse. /// /// @note Not all objects that derrive from GameBase have this defined.) /// /// </summary> public void applyRadialImpulse(string gamebase, Point3F origin, float radius, float magnitude){ m_ts.fnGameBase_applyRadialImpulse(gamebase, origin.AsString(), radius, magnitude); }
/// <summary> /// @brief Tells the AIPlayer to aim at the location provided. /// /// @param target An \"x y z\" position in the game world to target. /// /// @see getAimLocation()) /// /// </summary> public void setAimLocation(Point3F target) { TorqueScriptTemplate.m_ts.fnAIPlayer_setAimLocation(_mSimObjectId, target.AsString()); }
/// <summary> /// ) /// /// </summary> public void renderLine(string edittsctrl, Point3F start, Point3F end, float lineWidth){ m_ts.fnEditTSCtrl_renderLine(edittsctrl, start.AsString(), end.AsString(), lineWidth); }
/// <summary> /// ) /// /// </summary> public void renderTriangle(string edittsctrl, Point3F a, Point3F b, Point3F c){ m_ts.fnEditTSCtrl_renderTriangle(edittsctrl, a.AsString(), b.AsString(), c.AsString()); }
/// <summary> /// Set the velocity for the camera. /// @param velocity The camera's velocity in the form of \"x y z\". /// @note Only affects the Camera when in Newton mode.) /// /// </summary> public void setVelocity(string camera, Point3F velocity){ m_ts.fnCamera_setVelocity(camera, velocity.AsString()); }
/// <summary> /// ) /// /// </summary> public void renderBox(string edittsctrl, Point3F pos, Point3F size){ m_ts.fnEditTSCtrl_renderBox(edittsctrl, pos.AsString(), size.AsString()); }
/// <summary> /// Subtract two vectors. /// @param a The first vector. /// @param b The second vector. /// @return The vector @a a - @a b. /// @tsexample /// //----------------------------------------------------------------------------- /// // /// // VectorSub( %a, %b ); /// // /// // The difference of vector a, (ax, ay, az), and vector b, (bx, by, bz) is: /// // /// // a - b = ( ax - bx, ay - by, az - bz ) /// // /// //----------------------------------------------------------------------------- /// /// %a = \"1 0 0\"; /// %b = \"0 1 0\"; /// /// // %r = \"( 1 - 0, 0 - 1, 0 - 0 )\"; /// // %r = \"1 -1 0\"; /// %r = VectorSub( %a, %b ); /// @endtsexample /// @ingroup Vectors ) /// /// </summary> public Point3F VectorSub(Point3F a, Point3F b){ return new Point3F ( m_ts.fn_VectorSub(a.AsString(), b.AsString())); }
/// <summary> /// @brief Tells the AIPlayer to aim at the location provided. /// /// @param target An \"x y z\" position in the game world to target. /// /// @see getAimLocation()) /// /// </summary> public void setAimLocation(string aiplayer, Point3F target){ m_ts.fnAIPlayer_setAimLocation(aiplayer, target.AsString()); }
/// <summary> /// Brings a vector into its unit form, i.e. such that it has the magnitute 1. /// @param v The vector to normalize. /// @return The vector @a v scaled to length 1. /// @tsexample /// //----------------------------------------------------------------------------- /// // /// // VectorNormalize( %a ); /// // /// // The normalized vector a, (ax, ay, az), is: /// // /// // a^ = a / ||a|| /// // = ( ax / ||a||, ay / ||a||, az / ||a|| ) /// // /// //----------------------------------------------------------------------------- /// /// %a = \"1 1 0\"; /// %l = 1.414; /// /// // %r = \"( 1 / 1.141, 1 / 1.141, 0 / 1.141 )\"; /// // %r = \"0.707 0.707 0\"; /// %r = VectorNormalize( %a ); /// @endtsexample /// @ingroup Vectors ) /// /// </summary> public Point3F VectorNormalize(Point3F v){ return new Point3F ( m_ts.fn_VectorNormalize(v.AsString())); }
/// <summary> /// Scales a vector by a scalar. /// @param a The vector to scale. /// @param scalar The scale factor. /// @return The vector @a a * @a scalar. /// @tsexample /// //----------------------------------------------------------------------------- /// // /// // VectorScale( %a, %v ); /// // /// // Scaling vector a, (ax, ay, az), but the scalar, v, is: /// // /// // a * v = ( ax * v, ay * v, az * v ) /// // /// //----------------------------------------------------------------------------- /// /// %a = \"1 1 0\"; /// %v = \"2\"; /// /// // %r = \"( 1 * 2, 1 * 2, 0 * 2 )\"; /// // %r = \"2 2 0\"; /// %r = VectorScale( %a, %v ); /// @endtsexample /// @ingroup Vectors ) /// /// </summary> public Point3F VectorScale(Point3F a, float scalar){ return new Point3F ( m_ts.fn_VectorScale(a.AsString(), scalar)); }
/// <summary> /// Linearly interpolate between two vectors by @a t. /// @param a Vector to start interpolation from. /// @param b Vector to interpolate to. /// @param t Interpolation factor (0-1). At zero, @a a is returned and at one, @a b is returned. In between, an interpolated vector /// between @a a and @a b is returned. /// @return An interpolated vector between @a a and @a b. /// @tsexample /// //----------------------------------------------------------------------------- /// // /// // VectorLerp( %a, %b ); /// // /// // The point between vector a, (ax, ay, az), and vector b, (bx, by, bz), which is /// // weighted by the interpolation factor, t, is /// // /// // r = a + t * ( b - a ) /// // = ( ax + t * ( bx - ax ), ay + t * ( by - ay ), az + t * ( bz - az ) ) /// // /// //----------------------------------------------------------------------------- /// /// %a = \"1 1 0\"; /// %b = \"2 0 1\"; /// %v = \"0.25\"; /// /// // %r = \"( 1 + 0.25 * ( 2 - 1 ), 1 + 0.25 * ( 0 - 1 ), 0 + 0.25 * ( 1 - 0 ) )\"; /// // %r = \"1.25 0.75 0.25\"; /// %r = VectorLerp( %a, %b ); /// @endtsexample /// @ingroup Vectors ) /// /// </summary> public Point3F VectorLerp(Point3F a, Point3F b, float t){ return new Point3F ( m_ts.fn_VectorLerp(a.AsString(), b.AsString(), t)); }
/// <summary> /// Calculate the magnitude of the given vector. /// @param v A vector. /// @return The length of vector @a v. /// @tsexample /// //----------------------------------------------------------------------------- /// // /// // VectorLen( %a ); /// // /// // The length or magnitude of vector a, (ax, ay, az), is: /// // /// // ||a|| = Sqrt( ax * ax + ay * ay + az * az ) /// // /// //----------------------------------------------------------------------------- /// /// %a = \"1 1 0\"; /// /// // %r = mSqrt( 1 * 1 + 1 * 1 + 0 * 0 ); /// // %r = mSqrt( 2 ); /// // %r = 1.414; /// %r = VectorLen( %a ); /// @endtsexample /// @ingroup Vectors ) /// /// </summary> public float VectorLen(Point3F v){ return m_ts.fn_VectorLen(v.AsString()); }
/// <summary> /// Compute the dot product of two vectors. /// @param a The first vector. /// @param b The second vector. /// @return The dot product @a a * @a b. /// @tsexample /// //----------------------------------------------------------------------------- /// // /// // VectorDot( %a, %b ); /// // /// // The dot product between vector a, (ax, ay, az), and vector b, (bx, by, bz), is: /// // /// // a . b = ( ax * bx + ay * by + az * bz ) /// // /// //----------------------------------------------------------------------------- /// /// %a = \"1 1 0\"; /// %b = \"2 0 1\"; /// /// // %r = \"( 1 * 2 + 1 * 0 + 0 * 1 )\"; /// // %r = 2; /// %r = VectorDot( %a, %b ); /// @endtsexample /// @ingroup Vectors ) /// /// </summary> public float VectorDot(Point3F a, Point3F b){ return m_ts.fn_VectorDot(a.AsString(), b.AsString()); }
/// <summary> /// Set the camera's Euler rotation in radians. /// @param rot The rotation in radians in the form of \"x y z\". /// @note Rotation around the Y axis is ignored ) /// /// </summary> public void setRotation(string camera, Point3F rot){ m_ts.fnCamera_setRotation(camera, rot.AsString()); }
/// <summary> /// @brief Tells the AI to move to the location provided /// /// @param goal Coordinates in world space representing location to move to. /// @param slowDown A boolean value. If set to true, the bot will slow down /// when it gets within 5-meters of its move destination. If false, the bot /// will stop abruptly when it reaches the move destination. By default, this is true. /// /// @note Upon reaching a move destination, the bot will clear its move destination and /// calls to getMoveDestination will return \"0 0 0\". /// /// @see getMoveDestination()) /// /// </summary> public void setMoveDestination(string aiplayer, Point3F goal, bool slowDown){ m_ts.fnAIPlayer_setMoveDestination(aiplayer, goal.AsString(), slowDown); }
/// <summary> /// Set the camera to track a given object. /// @param trackObject The object to track. /// @param offset [optional] An offset added to the camera's position. Default is no offset. /// @returns false if the given object could not be found.) /// /// </summary> public bool setTrackObject(string camera, string trackObject, Point3F offset){ return m_ts.fnCamera_setTrackObject(camera, trackObject, offset.AsString()); }
/// <summary> /// Point the camera at the specified position. Does not work in Orbit or Track modes. /// @param point The position to point the camera at.) /// /// </summary> public void lookAt(string camera, Point3F point){ m_ts.fnCamera_lookAt(camera, point.AsString()); }
/// <summary> /// Draws a line primitive between two 3d points. ) /// /// </summary> public void drawLine(string debugdrawer, Point3F a, Point3F b, ColorF color){ m_ts.fnDebugDrawer_drawLine(debugdrawer, a.AsString(), b.AsString(), color.AsString()); }
/// <summary> /// Set the editor camera's orbit point. /// @param point The point the camera will orbit in the form of \"x y z\".) /// /// </summary> public void setEditOrbitPoint(string camera, Point3F point){ m_ts.fnCamera_setEditOrbitPoint(camera, point.AsString()); }
/// <summary> /// ) /// /// </summary> public void renderCircle(string edittsctrl, Point3F pos, Point3F normal, float radius, int segments){ m_ts.fnEditTSCtrl_renderCircle(edittsctrl, pos.AsString(), normal.AsString(), radius, segments); }
/// <summary> /// Set the camera's offset. /// The offset is added to the camera's position when set to CameraMode::OrbitObject. /// @param offset The distance to offset the camera by in the form of \"x y z\".) /// /// </summary> public void setOffset(string camera, Point3F offset){ m_ts.fnCamera_setOffset(camera, offset.AsString()); }
/// <summary> /// ) /// /// </summary> public void renderSphere(string edittsctrl, Point3F pos, float radius, int sphereLevel){ m_ts.fnEditTSCtrl_renderSphere(edittsctrl, pos.AsString(), radius, sphereLevel); }
/// <summary> /// Set the camera to orbit around the given object, or if none is given, around the given point. /// @param orbitObject The object to orbit around. If no object is given (0 or blank string is passed in) use the orbitPoint instead /// @param orbitPoint The point to orbit around when no object is given. In the form of \"x y z ax ay az aa\" such as returned by SceneObject::getTransform(). /// @param minDistance The minimum distance allowed to the orbit object or point. /// @param maxDistance The maximum distance allowed from the orbit object or point. /// @param initDistance The initial distance from the orbit object or point. /// @param ownClientObj [optional] Are we orbiting an object that is owned by us? Default is false. /// @param offset [optional] An offset added to the camera's position. Default is no offset. /// @param locked [optional] Indicates the camera does not receive input from the player. Default is false. /// @see Camera::setOrbitObject() /// @see Camera::setOrbitPoint()) /// /// </summary> public void setOrbitMode(string camera, string orbitObject, TransformF orbitPoint, float minDistance, float maxDistance, float initDistance, bool ownClientObj, Point3F offset, bool xlocked){ m_ts.fnCamera_setOrbitMode(camera, orbitObject, orbitPoint.AsString(), minDistance, maxDistance, initDistance, ownClientObj, offset.AsString(), xlocked); }
/// <summary> /// @brief Apply an impulse to this object as defined by a world position and velocity vector. /// /// @param pos impulse world position /// @param vel impulse velocity (impulse force F = m * v) /// @return Always true /// /// @note Not all objects that derrive from GameBase have this defined.) /// /// </summary> public bool applyImpulse(string gamebase, Point3F pos, Point3F vel){ return m_ts.fnGameBase_applyImpulse(gamebase, pos.AsString(), vel.AsString()); }
/// <summary> /// Set the camera to orbit around a given object. /// @param orbitObject The object to orbit around. /// @param rotation The initial camera rotation about the object in radians in the form of \"x y z\". /// @param minDistance The minimum distance allowed to the orbit object or point. /// @param maxDistance The maximum distance allowed from the orbit object or point. /// @param initDistance The initial distance from the orbit object or point. /// @param ownClientObject [optional] Are we orbiting an object that is owned by us? Default is false. /// @param offset [optional] An offset added to the camera's position. Default is no offset. /// @param locked [optional] Indicates the camera does not receive input from the player. Default is false. /// @returns false if the given object could not be found. /// @see Camera::setOrbitMode()) /// /// </summary> public bool setOrbitObject(string camera, string orbitObject, Point3F rotation, float minDistance, float maxDistance, float initDistance, bool ownClientObject, Point3F offset, bool xlocked){ return m_ts.fnCamera_setOrbitObject(camera, orbitObject, rotation.AsString(), minDistance, maxDistance, initDistance, ownClientObject, offset.AsString(), xlocked); }
public void ShapeBaseDamage(coShapeBase shapebase, coShapeBase sourceobject, Point3F position, float damage, string damagetype) { // All damage applied by one object to another should go through this method. // This function is provided to allow objects some chance of overriding or // processing damage values and types. As opposed to having weapons call // ShapeBase::applyDamage directly. Damage is redirected to the datablock, // this is standard procedure for many built in callbacks. if (shapebase.isObject()) { coShapeBaseData datablock = shapebase.getDataBlock(); datablock.call("damage", shapebase, position.AsString(), sourceobject, damage.AsString(), damagetype); } }
/// <summary> /// Set the camera to orbit around a given point. /// @param orbitPoint The point to orbit around. In the form of \"x y z ax ay az aa\" such as returned by SceneObject::getTransform(). /// @param minDistance The minimum distance allowed to the orbit object or point. /// @param maxDistance The maximum distance allowed from the orbit object or point. /// @param initDistance The initial distance from the orbit object or point. /// @param offset [optional] An offset added to the camera's position. Default is no offset. /// @param locked [optional] Indicates the camera does not receive input from the player. Default is false. /// @see Camera::setOrbitMode()) /// /// </summary> public void setOrbitPoint(string camera, TransformF orbitPoint, float minDistance, float maxDistance, float initDistance, Point3F offset, bool xlocked){ m_ts.fnCamera_setOrbitPoint(camera, orbitPoint.AsString(), minDistance, maxDistance, initDistance, offset.AsString(), xlocked); }
/// <summary> /// @brief Tells the AI to move to the location provided /// /// @param goal Coordinates in world space representing location to move to. /// @param slowDown A boolean value. If set to true, the bot will slow down /// when it gets within 5-meters of its move destination. If false, the bot /// will stop abruptly when it reaches the move destination. By default, this is true. /// /// @note Upon reaching a move destination, the bot will clear its move destination and /// calls to getMoveDestination will return \"0 0 0\". /// /// @see getMoveDestination()) /// /// </summary> public void setMoveDestination(Point3F goal, bool slowDown) { TorqueScriptTemplate.m_ts.fnAIPlayer_setMoveDestination(_mSimObjectId, goal.AsString(), slowDown); }
/// <summary> /// @brief Multiply the given point by the given transform assuming that w=1. /// This function will multiply the given vector such that translation with take effect. /// @param transform A transform. /// @param point A vector. /// @return The transformed vector. /// @ingroup Matrices) /// /// </summary> public Point3F MatrixMulPoint(TransformF transform, Point3F point){ return new Point3F ( m_ts.fn_MatrixMulPoint(transform.AsString(), point.AsString())); }