Exemple #1
0
 /// <summary>Add a torque to a dynamic physics shape.</summary>
 /// <description>
 ///
 /// </description>
 /// <param name="torque">to apply to the dynamic physics shape</param>
 /// <remarks> This value is ignored on physics shapes that are not dynamic. Wakes up the dynamic physics shape if it is sleeping.
 /// </remarks>
 public void ApplyTorque(Point3F torque)
 {
     torque.Alloc();             InternalUnsafeMethods.ApplyTorque__Args _args = new InternalUnsafeMethods.ApplyTorque__Args()
     {
         torque = torque.internalStructPtr,
     };
     InternalUnsafeMethods.ApplyTorque()(ObjectPtr, _args);
     torque.Free();
 }
Exemple #2
0
 /// <description>
 /// ai.setAimLocation( x y z );
 /// </description>
 public void SetAimLocation(Point3F v)
 {
     v.Alloc();             InternalUnsafeMethods.SetAimLocation__Args _args = new InternalUnsafeMethods.SetAimLocation__Args()
     {
         v = v.internalStructPtr,
     };
     InternalUnsafeMethods.SetAimLocation()(ObjectPtr, _args);
     v.Free();
 }
 ///
 public void SetNodeNormal(Point3F normal)
 {
     normal.Alloc();             InternalUnsafeMethods.SetNodeNormal__Args _args = new InternalUnsafeMethods.SetNodeNormal__Args()
     {
         normal = normal.internalStructPtr,
     };
     InternalUnsafeMethods.SetNodeNormal()(ObjectPtr, _args);
     normal.Free();
 }
Exemple #4
0
 /// <description>
 /// Transform 3D screen-space coordinates (x, y, depth) to world space.
 /// This method can be, for example, used to find the world-space position relating to the current mouse cursor position.
 /// </description>
 /// <param name="screenPosition">The x/y position on the screen plus the depth from the screen-plane outwards.</param>
 /// <returns>The world-space position corresponding to the given screen-space coordinates.</returns>
 public Point3F Unproject(Point3F screenPosition)
 {
     screenPosition.Alloc();             InternalUnsafeMethods.Unproject__Args _args = new InternalUnsafeMethods.Unproject__Args()
     {
         screenPosition = screenPosition.internalStructPtr,
     };
     Point3F.InternalStruct _engineResult = InternalUnsafeMethods.Unproject()(ObjectPtr, _args);
     screenPosition.Free();             return(new Point3F(_engineResult));
 }
Exemple #5
0
 /// <description>
 /// Get the number of static fields on the object.
 /// </description>
 /// <returns>The number of static fields defined on the object.</returns>
 public void LookAt(Point3F lookPosition)
 {
     lookPosition.Alloc();             InternalUnsafeMethods.LookAt__Args _args = new InternalUnsafeMethods.LookAt__Args()
     {
         lookPosition = lookPosition.internalStructPtr,
     };
     InternalUnsafeMethods.LookAt()(ObjectPtr, _args);
     lookPosition.Free();
 }
 ///
 public void SetNodePosition(Point3F pos)
 {
     pos.Alloc();             InternalUnsafeMethods.SetNodePosition__Args _args = new InternalUnsafeMethods.SetNodePosition__Args()
     {
         pos = pos.internalStructPtr,
     };
     InternalUnsafeMethods.SetNodePosition()(ObjectPtr, _args);
     pos.Free();
 }
 /// <description>
 /// Set the starting velocity-vector for a magic-missile.
 /// </description>
 public void SetStartingVelocityVector(Point3F velocityVec)
 {
     velocityVec.Alloc();             InternalUnsafeMethods.SetStartingVelocityVector__Args _args = new InternalUnsafeMethods.SetStartingVelocityVector__Args()
     {
         velocityVec = velocityVec.internalStructPtr,
     };
     InternalUnsafeMethods.SetStartingVelocityVector()(ObjectPtr, _args);
     velocityVec.Free();
 }
Exemple #8
0
 /// <summary>Add a force to a dynamic physics shape.</summary>
 /// <description>
 ///
 /// </description>
 /// <param name="force">to apply to the dynamic physics shape</param>
 /// <remarks> This value is ignored on physics shapes that are not dynamic. Wakes up the dynamic physics shape if it is sleeping.
 /// </remarks>
 public void ApplyForce(Point3F force)
 {
     force.Alloc();             InternalUnsafeMethods.ApplyForce__Args _args = new InternalUnsafeMethods.ApplyForce__Args()
     {
         force = force.internalStructPtr,
     };
     InternalUnsafeMethods.ApplyForce()(ObjectPtr, _args);
     force.Free();
 }
Exemple #9
0
 /// <description>
 /// Transform world-space coordinates to screen-space (x, y, depth) coordinates.
 /// </description>
 /// <param name="worldPosition">The world-space position to transform to screen-space.</param>
 /// <returns>The</returns>
 public Point3F Project(Point3F worldPosition)
 {
     worldPosition.Alloc();             InternalUnsafeMethods.Project__Args _args = new InternalUnsafeMethods.Project__Args()
     {
         worldPosition = worldPosition.internalStructPtr,
     };
     Point3F.InternalStruct _engineResult = InternalUnsafeMethods.Project()(ObjectPtr, _args);
     worldPosition.Free();             return(new Point3F(_engineResult));
 }
Exemple #10
0
 /// <summary>Set Euler rotation of this turret's heading and pitch nodes in degrees.</summary>
 /// <description>
 ///
 /// </description>
 /// <param name="rot">The rotation in degrees.  The pitch is the X component and the heading is the Z component.  The Y component is ignored.</param>
 public void SetTurretEulerRotation(Point3F rot)
 {
     rot.Alloc();             InternalUnsafeMethods.SetTurretEulerRotation__Args _args = new InternalUnsafeMethods.SetTurretEulerRotation__Args()
     {
         rot = rot.internalStructPtr,
     };
     InternalUnsafeMethods.SetTurretEulerRotation()(ObjectPtr, _args);
     rot.Free();
 }
Exemple #11
0
 /// <description>
 /// Set the object's scale.
 /// </description>
 /// <param name="scale">object scale to set</param>
 public void SetScale(Point3F scale)
 {
     scale.Alloc();             InternalUnsafeMethods.SetScale__Args _args = new InternalUnsafeMethods.SetScale__Args()
     {
         scale = scale.internalStructPtr,
     };
     InternalUnsafeMethods.SetScale()(ObjectPtr, _args);
     scale.Free();
 }
Exemple #12
0
 /// <summary>Set the light direction from which to light the model.</summary>
 /// <description>
 ///
 /// </description>
 /// <param name="direction">XYZ direction from which the light will shine on the model</param>
 /// <code>
 /// // Set the light direction
 /// %direction = "1.0 0.2 0.4"
 ///
 /// // Inform the GuiObjectView object to change the light direction to the defined value
 /// %thisGuiObjectView.setLightDirection(%direction);
 /// </code>
 /// <see cref="GuiControl" />
 public void SetLightDirection(Point3F direction)
 {
     direction.Alloc();             InternalUnsafeMethods.SetLightDirection__Args _args = new InternalUnsafeMethods.SetLightDirection__Args()
     {
         direction = direction.internalStructPtr,
     };
     InternalUnsafeMethods.SetLightDirection()(ObjectPtr, _args);
     direction.Free();
 }
Exemple #13
0
 /// <summary>Helper method to get a transform from a position and vector (suitable for use with setTransform).</summary>
 /// <description>
 ///
 /// </description>
 /// <param name="pos">Desired transform position</param>
 /// <param name="normal">Vector of desired direction</param>
 /// <returns>The deploy transform</returns>
 public TransformF GetDeployTransform(Point3F pos, Point3F normal)
 {
     pos.Alloc(); normal.Alloc();             InternalUnsafeMethods.GetDeployTransform__Args _args = new InternalUnsafeMethods.GetDeployTransform__Args()
     {
         pos    = pos.internalStructPtr,
         normal = normal.internalStructPtr,
     };
     TransformF.InternalStruct _engineResult = InternalUnsafeMethods.GetDeployTransform()(ObjectPtr, _args);
     pos.Free(); normal.Free();             return(new TransformF(_engineResult));
 }
Exemple #14
0
 ///
 public void RenderBox(Point3F pos, Point3F size)
 {
     pos.Alloc(); size.Alloc();             InternalUnsafeMethods.RenderBox__Args _args = new InternalUnsafeMethods.RenderBox__Args()
     {
         pos  = pos.internalStructPtr,
         size = size.internalStructPtr,
     };
     InternalUnsafeMethods.RenderBox()(ObjectPtr, _args);
     pos.Free(); size.Free();
 }
Exemple #15
0
 /// <description>
 /// Callback invoked when a ProximityMine is about to explode.
 /// </description>
 /// <param name="obj">The ProximityMine object</param>
 /// <param name="pos">The position of the mine explosion</param>
 /// <remarks> This callback is only invoked on the server.
 /// </remarks>
 /// <see cref="ProximityMine" />
 public virtual void OnExplode(ProximityMine obj, Point3F pos)
 {
     pos.Alloc();             InternalUnsafeMethods.OnExplode__Args _args = new InternalUnsafeMethods.OnExplode__Args()
     {
         obj = obj.ObjectPtr,
         pos = pos.internalStructPtr,
     };
     InternalUnsafeMethods.OnExplode()(ObjectPtr, _args);
     pos.Free();
 }
Exemple #16
0
        /// <summary>Get the named damage location and modifier for a given world position.</summary>
        /// <description>
        /// the Player object can simulate different hit locations based on a pre-defined set of PlayerData defined percentages.  These hit percentages divide up the Player's bounding box into different regions.  The diagram below demonstrates how the various PlayerData properties split up the bounding volume:
        ///
        /// <img src="images/player_damageloc.png">
        ///
        /// While you may pass in any world position and getDamageLocation() will provide a best-fit location, you should be aware that this can produce some interesting results.  For example, any position that is above PlayerData::boxHeadPercentage will be considered a 'head' hit, even if the world position is high in the sky.  Therefore it may be wise to keep the passed in point to somewhere on the surface of, or within, the Player's bounding volume.
        /// </description>
        /// <remarks> This method will not return an accurate location when the player is prone or swimming.
        ///
        /// </remarks>
        /// <param name="pos">A world position for which to retrieve a body region on this player.</param>
        /// <returns>a string containing two words (space separated strings), where the first is a location and the second is a modifier.
        ///
        /// Posible locations:<ul><li>head</li><li>torso</li><li>legs</li></ul>
        /// Head modifiers:<ul><li>left_back</li><li>middle_back</li><li>right_back</li><li>left_middle</li><li>middle_middle</li><li>right_middle</li><li>left_front</li><li>middle_front</li><li>right_front</li></ul>
        /// Legs/Torso modifiers:<ul><li>front_left</li><li>front_right</li><li>back_left</li><li>back_right</li></ul></returns>
        /// <see cref="PlayerData::boxHeadPercentage" />
        /// <see cref="PlayerData::boxHeadFrontPercentage" />
        /// <see cref="PlayerData::boxHeadBackPercentage" />
        /// <see cref="PlayerData::boxHeadLeftPercentage" />
        /// <see cref="PlayerData::boxHeadRightPercentage" />
        /// <see cref="PlayerData::boxTorsoPercentage" />
        public string GetDamageLocation(Point3F pos)
        {
            pos.Alloc();             InternalUnsafeMethods.GetDamageLocation__Args _args = new InternalUnsafeMethods.GetDamageLocation__Args()
            {
                pos = pos.internalStructPtr,
            };
            IntPtr _engineResult = InternalUnsafeMethods.GetDamageLocation()(ObjectPtr, _args);

            pos.Free();             return(StringMarshal.IntPtrToUtf8String(_engineResult));
        }
 /// <description>
 /// Move all objects in the selection by the given delta.
 /// </description>
 public void Offset(Point3F delta, float gridSnap = 0f)
 {
     delta.Alloc();             InternalUnsafeMethods.Offset__Args _args = new InternalUnsafeMethods.Offset__Args()
     {
         delta    = delta.internalStructPtr,
         gridSnap = gridSnap,
     };
     InternalUnsafeMethods.Offset()(ObjectPtr, _args);
     delta.Free();
 }
Exemple #18
0
        /// <summary>Apply an impulse to this object as defined by a world position and velocity vector.</summary>
        /// <description>
        ///
        /// </description>
        /// <param name="pos">impulse world position</param>
        /// <param name="vel">impulse velocity (impulse force F = m * v)</param>
        /// <returns>Always true</returns>
        /// <remarks> Not all objects that derrive from GameBase have this defined.
        /// </remarks>
        public float GetBestCollisionAngle(Point3F upVector)
        {
            upVector.Alloc();             InternalUnsafeMethods.GetBestCollisionAngle__Args _args = new InternalUnsafeMethods.GetBestCollisionAngle__Args()
            {
                upVector = upVector.internalStructPtr,
            };
            float _engineResult = InternalUnsafeMethods.GetBestCollisionAngle()(ObjectPtr, _args);

            upVector.Free();             return(_engineResult);
        }
Exemple #19
0
 /// <description>
 /// ( pPosition )
 /// </description>
 public void SetNodePosition(Point3F position = null)
 {
     position = position ?? new Point3F("0 0 0");
     position.Alloc();             InternalUnsafeMethods.SetNodePosition__Args _args = new InternalUnsafeMethods.SetNodePosition__Args()
     {
         position = position.internalStructPtr,
     };
     InternalUnsafeMethods.SetNodePosition()(ObjectPtr, _args);
     position.Free();
 }
Exemple #20
0
 /// <summary>Mount objB to this object at the desired slot with optional transform.</summary>
 /// <description>
 ///
 /// </description>
 /// <param name="objB">Object to mount onto us</param>
 /// <param name="slot">Mount slot ID</param>
 /// <param name="txfm">(optional) mount offset transform</param>
 /// <returns>true if successful, false if failed (objB is not valid)</returns>
 public void SetMountRotation(Point3F rotOffset = null)
 {
     rotOffset = rotOffset ?? new Point3F("0 0 0");
     rotOffset.Alloc();             InternalUnsafeMethods.SetMountRotation__Args _args = new InternalUnsafeMethods.SetMountRotation__Args()
     {
         rotOffset = rotOffset.internalStructPtr,
     };
     InternalUnsafeMethods.SetMountRotation()(ObjectPtr, _args);
     rotOffset.Free();
 }
Exemple #21
0
 /// <summary>Disassociates the PhysicsForce from any attached PhysicsBody.</summary>
 /// <description>
 ///
 /// </description>
 /// <param name="force">Optional force to apply to the attached PhysicsBody before detaching.</param>
 /// <remarks> Has no effect if the %PhysicsForce is not attached to anything.
 ///
 /// </remarks>
 public void Detach(Point3F force = null)
 {
     force = force ?? new Point3F("0 0 0");
     force.Alloc();             InternalUnsafeMethods.Detach__Args _args = new InternalUnsafeMethods.Detach__Args()
     {
         force = force.internalStructPtr,
     };
     InternalUnsafeMethods.Detach()(ObjectPtr, _args);
     force.Free();
 }
Exemple #22
0
 /// <summary>Mount objB to this object at the desired slot with optional transform.</summary>
 /// <description>
 ///
 /// </description>
 /// <param name="objB">Object to mount onto us</param>
 /// <param name="slot">Mount slot ID</param>
 /// <param name="txfm">(optional) mount offset transform</param>
 /// <returns>true if successful, false if failed (objB is not valid)</returns>
 public void SetMountOffset(Point3F posOffset = null)
 {
     posOffset = posOffset ?? new Point3F("0 0 0");
     posOffset.Alloc();             InternalUnsafeMethods.SetMountOffset__Args _args = new InternalUnsafeMethods.SetMountOffset__Args()
     {
         posOffset = posOffset.internalStructPtr,
     };
     InternalUnsafeMethods.SetMountOffset()(ObjectPtr, _args);
     posOffset.Free();
 }
 /// <description>
 /// Get the number of static fields on the object.
 /// </description>
 /// <returns>The number of static fields defined on the object.</returns>
 public void SetForwardVector(Point3F newForward = null)
 {
     newForward = newForward ?? new Point3F("0 0 0");
     newForward.Alloc();             InternalUnsafeMethods.SetForwardVector__Args _args = new InternalUnsafeMethods.SetForwardVector__Args()
     {
         newForward = newForward.internalStructPtr,
     };
     InternalUnsafeMethods.SetForwardVector()(ObjectPtr, _args);
     newForward.Free();
 }
Exemple #24
0
 /// <summary>Mount objB to this object at the desired slot with optional transform.</summary>
 /// <description>
 ///
 /// </description>
 /// <param name="objB">Object to mount onto us</param>
 /// <param name="slot">Mount slot ID</param>
 /// <param name="txfm">(optional) mount offset transform</param>
 /// <returns>true if successful, false if failed (objB is not valid)</returns>
 public void SetBox(Point3F box = null)
 {
     box = box ?? new Point3F("1 1 1");
     box.Alloc();             InternalUnsafeMethods.SetBox__Args _args = new InternalUnsafeMethods.SetBox__Args()
     {
         box = box.internalStructPtr,
     };
     InternalUnsafeMethods.SetBox()(ObjectPtr, _args);
     box.Free();
 }
Exemple #25
0
        /// <description>
        /// Get the off-mesh link closest to a given world point.
        /// </description>
        public int GetLink(Point3F pos)
        {
            pos.Alloc();             InternalUnsafeMethods.GetLink__Args _args = new InternalUnsafeMethods.GetLink__Args()
            {
                pos = pos.internalStructPtr,
            };
            int _engineResult = InternalUnsafeMethods.GetLink()(ObjectPtr, _args);

            pos.Free();             return(_engineResult);
        }
Exemple #26
0
 /// <description>
 /// Get the number of static fields on the object.
 /// </description>
 /// <returns>The number of static fields defined on the object.</returns>
 public void RotateTo(Point3F lookPosition, float degreePerSecond = 1f)
 {
     lookPosition.Alloc();             InternalUnsafeMethods.RotateTo__Args _args = new InternalUnsafeMethods.RotateTo__Args()
     {
         lookPosition    = lookPosition.internalStructPtr,
         degreePerSecond = degreePerSecond,
     };
     InternalUnsafeMethods.RotateTo()(ObjectPtr, _args);
     lookPosition.Free();
 }
Exemple #27
0
 /// <description>
 /// Informs an object that it was hit by a lightning bolt and needs to take damage.
 /// </description>
 /// <param name="hitPosition">World position hit by the lightning bolt.</param>
 /// <param name="hitNormal">Surface normal at<paramref name="" /> hitPosition.
 /// </param>
 /// <param name="hitObject">Player or Vehicle object that was hit.</param>
 /// <code>
 /// function Lightning::applyDamage( %this, %hitPosition, %hitNormal, %hitObject )
 /// {
 ///    // apply damage to the player
 ///    %hitObject.applyDamage( 25 );
 /// }
 /// </code>
 public virtual void ApplyDamage(Point3F hitPosition, Point3F hitNormal, SceneObject hitObject)
 {
     hitPosition.Alloc(); hitNormal.Alloc();             InternalUnsafeMethods.ApplyDamage__Args _args = new InternalUnsafeMethods.ApplyDamage__Args()
     {
         hitPosition = hitPosition.internalStructPtr,
         hitNormal   = hitNormal.internalStructPtr,
         hitObject   = hitObject.ObjectPtr,
     };
     InternalUnsafeMethods.ApplyDamage()(ObjectPtr, _args);
     hitPosition.Free(); hitNormal.Free();
 }
Exemple #28
0
 /// <summary>Called when a projectile explodes.</summary>
 /// <description>
 /// This function is only called on server objects.
 /// </description>
 /// <param name="proj">The exploding projectile.</param>
 /// <param name="pos">The position of the explosion.</param>
 /// <param name="fade">The current fadeValue of the projectile, affects its visibility.</param>
 /// <see cref="Projectile" />
 public virtual void OnExplode(Projectile proj, Point3F pos, float fade)
 {
     pos.Alloc();             InternalUnsafeMethods.OnExplode__Args _args = new InternalUnsafeMethods.OnExplode__Args()
     {
         proj = proj.ObjectPtr,
         pos  = pos.internalStructPtr,
         fade = fade,
     };
     InternalUnsafeMethods.OnExplode()(ObjectPtr, _args);
     pos.Free();
 }
Exemple #29
0
        /// <summary>Check if it is safe to dismount at this position.</summary>
        /// <description>
        /// Internally this method casts a ray from oldPos to pos to determine if it hits the terrain, an interior object, a water object, another player, a static shape, a vehicle (exluding the one currently mounted), or physical zone.  If this ray is in the clear, then the player's bounding box is also checked for a collision at the pos position.  If this displaced bounding box is also in the clear, then checkDismountPoint() returns true.
        /// </description>
        /// <param name="oldPos">The player's current position</param>
        /// <param name="pos">The dismount position to check</param>
        /// <returns>True if the dismount position is clear, false if not</returns>
        /// <remarks> The player must be already mounted for this method to not assert.
        /// </remarks>
        public bool CheckDismountPoint(Point3F oldPos, Point3F pos)
        {
            oldPos.Alloc(); pos.Alloc();             InternalUnsafeMethods.CheckDismountPoint__Args _args = new InternalUnsafeMethods.CheckDismountPoint__Args()
            {
                oldPos = oldPos.internalStructPtr,
                pos    = pos.internalStructPtr,
            };
            bool _engineResult = InternalUnsafeMethods.CheckDismountPoint()(ObjectPtr, _args);

            oldPos.Free(); pos.Free();             return(_engineResult);
        }
Exemple #30
0
 /// <summary>Attempts to associate the PhysicsForce with a PhysicsBody.</summary>
 /// <description>
 /// Performs a physics ray cast of the provided length and direction. The %PhysicsForce will attach itself to the first dynamic PhysicsBody the ray collides with. On every tick, the attached body will be attracted towards the position of the %PhysicsForce.
 ///
 /// A %PhysicsForce can only be attached to one body at a time.
 /// </description>
 /// <remarks> To determine if an %attach was successful, check isAttached() immediately after calling this function.n
 /// </remarks>
 public void Attach(Point3F start, Point3F direction, float maxDist)
 {
     start.Alloc(); direction.Alloc();             InternalUnsafeMethods.Attach__Args _args = new InternalUnsafeMethods.Attach__Args()
     {
         start     = start.internalStructPtr,
         direction = direction.internalStructPtr,
         maxDist   = maxDist,
     };
     InternalUnsafeMethods.Attach()(ObjectPtr, _args);
     start.Free(); direction.Free();
 }