Explorar o código

removed types from comments; added references to physics documentation

Kacey Coley %!s(int64=7) %!d(string=hai) anos
pai
achega
f87742059a

+ 45 - 39
src/Physics/babylon.physicsHelper.ts

@@ -2,6 +2,7 @@ module BABYLON {
 
 
     /**
     /**
      * A helper for physics simulations
      * A helper for physics simulations
+     * @see https://doc.babylonjs.com/how_to/using_the_physics_engine
      */
      */
     export class PhysicsHelper {
     export class PhysicsHelper {
 
 
@@ -23,10 +24,10 @@ module BABYLON {
 
 
         /**
         /**
          * Applies a radial explosion impulse
          * Applies a radial explosion impulse
-         * @param {Vector3} origin the origin of the explosion
-         * @param {number} radius the explosion radius
-         * @param {number} strength the explosion strength
-         * @param {PhysicsRadialImpulseFalloff} falloff possible options: Constant & Linear. Defaults to Constant
+         * @param origin the origin of the explosion
+         * @param radius the explosion radius
+         * @param strength the explosion strength
+         * @param falloff possible options: Constant & Linear. Defaults to Constant
          * @returns A physics radial explosion event, or null
          * @returns A physics radial explosion event, or null
          */
          */
         public applyRadialExplosionImpulse(origin: Vector3, radius: number, strength: number, falloff: PhysicsRadialImpulseFalloff = PhysicsRadialImpulseFalloff.Constant): Nullable<PhysicsRadialExplosionEvent> {
         public applyRadialExplosionImpulse(origin: Vector3, radius: number, strength: number, falloff: PhysicsRadialImpulseFalloff = PhysicsRadialImpulseFalloff.Constant): Nullable<PhysicsRadialExplosionEvent> {
@@ -58,10 +59,10 @@ module BABYLON {
 
 
         /**
         /**
          * Applies a radial explosion force
          * Applies a radial explosion force
-         * @param {Vector3} origin the origin of the explosion
-         * @param {number} radius the explosion radius
-         * @param {number} strength the explosion strength
-         * @param {PhysicsRadialImpulseFalloff} falloff possible options: Constant & Linear. Defaults to Constant
+         * @param origin the origin of the explosion
+         * @param radius the explosion radius
+         * @param strength the explosion strength
+         * @param falloff possible options: Constant & Linear. Defaults to Constant
          * @returns A physics radial explosion event, or null
          * @returns A physics radial explosion event, or null
          */
          */
         public applyRadialExplosionForce(origin: Vector3, radius: number, strength: number, falloff: PhysicsRadialImpulseFalloff = PhysicsRadialImpulseFalloff.Constant): Nullable<PhysicsRadialExplosionEvent> {
         public applyRadialExplosionForce(origin: Vector3, radius: number, strength: number, falloff: PhysicsRadialImpulseFalloff = PhysicsRadialImpulseFalloff.Constant): Nullable<PhysicsRadialExplosionEvent> {
@@ -93,10 +94,10 @@ module BABYLON {
 
 
         /**
         /**
          * Creates a gravitational field
          * Creates a gravitational field
-         * @param {Vector3} origin the origin of the explosion
-         * @param {number} radius the explosion radius
-         * @param {number} strength the explosion strength
-         * @param {PhysicsRadialImpulseFalloff} falloff possible options: Constant & Linear. Defaults to Constant
+         * @param origin the origin of the explosion
+         * @param radius the explosion radius
+         * @param strength the explosion strength
+         * @param falloff possible options: Constant & Linear. Defaults to Constant
          * @returns A physics gravitational field event, or null
          * @returns A physics gravitational field event, or null
          */
          */
         public gravitationalField(origin: Vector3, radius: number, strength: number, falloff: PhysicsRadialImpulseFalloff = PhysicsRadialImpulseFalloff.Constant): Nullable<PhysicsGravitationalFieldEvent> {
         public gravitationalField(origin: Vector3, radius: number, strength: number, falloff: PhysicsRadialImpulseFalloff = PhysicsRadialImpulseFalloff.Constant): Nullable<PhysicsGravitationalFieldEvent> {
@@ -119,11 +120,11 @@ module BABYLON {
 
 
         /**
         /**
          * Creates a physics updraft event
          * Creates a physics updraft event
-         * @param {Vector3} origin the origin of the updraft
-         * @param {number} radius the radius of the updraft
-         * @param {number} strength the strength of the updraft
-         * @param {number} height the height of the updraft
-         * @param {PhysicsUpdraftMode} updraftMode possible options: Center & Perpendicular. Defaults to Center
+         * @param origin the origin of the updraft
+         * @param radius the radius of the updraft
+         * @param strength the strength of the updraft
+         * @param height the height of the updraft
+         * @param updraftMode possible options: Center & Perpendicular. Defaults to Center
          * @returns A physics updraft event, or null
          * @returns A physics updraft event, or null
          */
          */
         public updraft(origin: Vector3, radius: number, strength: number, height: number, updraftMode: PhysicsUpdraftMode = PhysicsUpdraftMode.Center): Nullable<PhysicsUpdraftEvent> {
         public updraft(origin: Vector3, radius: number, strength: number, height: number, updraftMode: PhysicsUpdraftMode = PhysicsUpdraftMode.Center): Nullable<PhysicsUpdraftEvent> {
@@ -145,10 +146,10 @@ module BABYLON {
 
 
         /**
         /**
          * Creates a physics vortex event
          * Creates a physics vortex event
-         * @param {Vector3} origin the of the vortex
-         * @param {number} radius the radius of the vortex
-         * @param {number} strength the strength of the vortex
-         * @param {number} height   the height of the vortex
+         * @param origin the of the vortex
+         * @param radius the radius of the vortex
+         * @param strength the strength of the vortex
+         * @param height   the height of the vortex
          * @returns a Physics vortex event, or null
          * @returns a Physics vortex event, or null
          * A physics vortex event or null
          * A physics vortex event or null
          */
          */
@@ -172,6 +173,7 @@ module BABYLON {
 
 
     /**
     /**
      * Represents a physics radial explosion event
      * Represents a physics radial explosion event
+     * @see https://doc.babylonjs.com/how_to/using_the_physics_engine
      */
      */
     export class PhysicsRadialExplosionEvent {
     export class PhysicsRadialExplosionEvent {
 
 
@@ -191,7 +193,7 @@ module BABYLON {
 
 
         /**
         /**
          * Returns the data related to the radial explosion event (sphere & rays).
          * Returns the data related to the radial explosion event (sphere & rays).
-         * @returns {PhysicsRadialExplosionEventData} The radial explosion event data
+         * @returns The radial explosion event data
          */
          */
         public getData(): PhysicsRadialExplosionEventData {
         public getData(): PhysicsRadialExplosionEventData {
             this._dataFetched = true;
             this._dataFetched = true;
@@ -205,10 +207,10 @@ module BABYLON {
         /**
         /**
          * Returns the force and contact point of the impostor or false, if the impostor is not affected by the force/impulse.
          * Returns the force and contact point of the impostor or false, if the impostor is not affected by the force/impulse.
          * @param impostor A physics imposter
          * @param impostor A physics imposter
-         * @param {Vector3} origin the origin of the explosion
-         * @param {number} radius the explosion radius
-         * @param {number} strength the explosion strength
-         * @param {PhysicsRadialImpulseFalloff} falloff possible options: Constant & Linear
+         * @param origin the origin of the explosion
+         * @param radius the explosion radius
+         * @param strength the explosion strength
+         * @param falloff possible options: Constant & Linear
          * @returns {Nullable<PhysicsForceAndContactPoint>} A physics force and contact point, or null
          * @returns {Nullable<PhysicsForceAndContactPoint>} A physics force and contact point, or null
          */
          */
         public getImpostorForceAndContactPoint(impostor: PhysicsImpostor, origin: Vector3, radius: number, strength: number, falloff: PhysicsRadialImpulseFalloff): Nullable<PhysicsForceAndContactPoint> {
         public getImpostorForceAndContactPoint(impostor: PhysicsImpostor, origin: Vector3, radius: number, strength: number, falloff: PhysicsRadialImpulseFalloff): Nullable<PhysicsForceAndContactPoint> {
@@ -252,7 +254,7 @@ module BABYLON {
 
 
         /**
         /**
          * Disposes the sphere.
          * Disposes the sphere.
-         * @param {bolean} force Specifies if the sphere should be disposed by force
+         * @param force Specifies if the sphere should be disposed by force
          */
          */
         public dispose(force: boolean = true) {
         public dispose(force: boolean = true) {
             if (force) {
             if (force) {
@@ -292,6 +294,7 @@ module BABYLON {
 
 
     /**
     /**
      * Represents a gravitational field event
      * Represents a gravitational field event
+     * @see https://doc.babylonjs.com/how_to/using_the_physics_engine
      */
      */
     export class PhysicsGravitationalFieldEvent {
     export class PhysicsGravitationalFieldEvent {
 
 
@@ -326,7 +329,7 @@ module BABYLON {
 
 
         /**
         /**
          * Returns the data related to the gravitational field event (sphere).
          * Returns the data related to the gravitational field event (sphere).
-         * @returns {PhysicsGravitationalFieldEventData} A gravitational field event
+         * @returns A gravitational field event
          */
          */
         public getData(): PhysicsGravitationalFieldEventData {
         public getData(): PhysicsGravitationalFieldEventData {
             this._dataFetched = true;
             this._dataFetched = true;
@@ -353,7 +356,7 @@ module BABYLON {
 
 
         /**
         /**
          * Disposes the sphere.
          * Disposes the sphere.
-         * @param {bolean} force The force to dispose from the gravitational field event
+         * @param force The force to dispose from the gravitational field event
          */
          */
         public dispose(force: boolean = true) {
         public dispose(force: boolean = true) {
             if (force) {
             if (force) {
@@ -383,6 +386,7 @@ module BABYLON {
 
 
     /**
     /**
      * Represents a physics updraft event
      * Represents a physics updraft event
+     * @see https://doc.babylonjs.com/how_to/using_the_physics_engine
      */
      */
     export class PhysicsUpdraftEvent {
     export class PhysicsUpdraftEvent {
 
 
@@ -418,7 +422,7 @@ module BABYLON {
 
 
         /**
         /**
          * Returns the data related to the updraft event (cylinder).
          * Returns the data related to the updraft event (cylinder).
-         * @returns {PhysicsUpdraftEventData} A physics updraft event
+         * @returns A physics updraft event
          */
          */
         public getData(): PhysicsUpdraftEventData {
         public getData(): PhysicsUpdraftEventData {
             this._dataFetched = true;
             this._dataFetched = true;
@@ -445,7 +449,7 @@ module BABYLON {
 
 
         /**
         /**
          * Disposes the sphere.
          * Disposes the sphere.
-         * @param {bolean} force Specifies if the updraft should be disposed by force
+         * @param force Specifies if the updraft should be disposed by force
          */
          */
         public dispose(force: boolean = true) {
         public dispose(force: boolean = true) {
             if (force) {
             if (force) {
@@ -520,6 +524,7 @@ module BABYLON {
 
 
     /**
     /**
      * Represents a physics vortex event
      * Represents a physics vortex event
+     * @see https://doc.babylonjs.com/how_to/using_the_physics_engine
      */
      */
     export class PhysicsVortexEvent {
     export class PhysicsVortexEvent {
 
 
@@ -551,7 +556,7 @@ module BABYLON {
 
 
         /**
         /**
          * Returns the data related to the vortex event (cylinder).
          * Returns the data related to the vortex event (cylinder).
-         * @returns {PhysicsVortexEventData} The physics vortex event data
+         * @returns The physics vortex event data
          */
          */
         public getData(): PhysicsVortexEventData {
         public getData(): PhysicsVortexEventData {
             this._dataFetched = true;
             this._dataFetched = true;
@@ -578,7 +583,7 @@ module BABYLON {
 
 
         /**
         /**
          * Disposes the sphere.
          * Disposes the sphere.
-         * @param {bolean} force
+         * @param force
          */
          */
         public dispose(force: boolean = true) {
         public dispose(force: boolean = true) {
             if (force) {
             if (force) {
@@ -675,11 +680,9 @@ module BABYLON {
 
 
     }
     }
 
 
-
-    /***** Enums *****/
-
     /**
     /**
     * The strenght of the force in correspondence to the distance of the affected object
     * The strenght of the force in correspondence to the distance of the affected object
+    * @see https://doc.babylonjs.com/how_to/using_the_physics_engine
     */
     */
     export enum PhysicsRadialImpulseFalloff {
     export enum PhysicsRadialImpulseFalloff {
         /** Defines that impulse is constant in strength across it's whole radius */
         /** Defines that impulse is constant in strength across it's whole radius */
@@ -690,6 +693,7 @@ module BABYLON {
 
 
     /**
     /**
      * The strength of the force in correspondence to the distance of the affected object
      * The strength of the force in correspondence to the distance of the affected object
+     * @see https://doc.babylonjs.com/how_to/using_the_physics_engine
      */
      */
     export enum PhysicsUpdraftMode {
     export enum PhysicsUpdraftMode {
         /** Defines that the upstream forces will pull towards the top center of the cylinder */
         /** Defines that the upstream forces will pull towards the top center of the cylinder */
@@ -698,11 +702,9 @@ module BABYLON {
         Perpendicular
         Perpendicular
     }
     }
 
 
-
-    /***** Data interfaces *****/
-
     /**
     /**
      * Interface for a physics force and contact point
      * Interface for a physics force and contact point
+     * @see https://doc.babylonjs.com/how_to/using_the_physics_engine
      */
      */
     export interface PhysicsForceAndContactPoint {
     export interface PhysicsForceAndContactPoint {
         force: Vector3;
         force: Vector3;
@@ -711,6 +713,7 @@ module BABYLON {
 
 
     /**
     /**
      * Interface for radial explosion event data
      * Interface for radial explosion event data
+     * @see https://doc.babylonjs.com/how_to/using_the_physics_engine
      */
      */
     export interface PhysicsRadialExplosionEventData {
     export interface PhysicsRadialExplosionEventData {
         sphere: Mesh;
         sphere: Mesh;
@@ -719,6 +722,7 @@ module BABYLON {
 
 
     /**
     /**
      * Interface for gravitational field event data
      * Interface for gravitational field event data
+     * @see https://doc.babylonjs.com/how_to/using_the_physics_engine
      */
      */
     export interface PhysicsGravitationalFieldEventData {
     export interface PhysicsGravitationalFieldEventData {
         sphere: Mesh;
         sphere: Mesh;
@@ -726,6 +730,7 @@ module BABYLON {
 
 
     /**
     /**
      * Interface for updraft event data
      * Interface for updraft event data
+     * @see https://doc.babylonjs.com/how_to/using_the_physics_engine
      */
      */
     export interface PhysicsUpdraftEventData {
     export interface PhysicsUpdraftEventData {
         cylinder: Mesh;
         cylinder: Mesh;
@@ -733,6 +738,7 @@ module BABYLON {
 
 
     /**
     /**
      * Interface for vortex event data
      * Interface for vortex event data
+     * @see https://doc.babylonjs.com/how_to/using_the_physics_engine
      */
      */
     export interface PhysicsVortexEventData {
     export interface PhysicsVortexEventData {
         cylinder: Mesh;
         cylinder: Mesh;

+ 3 - 0
src/Physics/babylon.physicsImpostor.ts

@@ -2,6 +2,7 @@ module BABYLON {
 
 
     /**
     /**
      * The interface for the physics imposter parameters
      * The interface for the physics imposter parameters
+     * @see https://doc.babylonjs.com/how_to/using_the_physics_engine
      */
      */
     export interface PhysicsImpostorParameters {
     export interface PhysicsImpostorParameters {
         /**
         /**
@@ -32,6 +33,7 @@ module BABYLON {
 
 
     /**
     /**
      * Interface for a physics-enabled object
      * Interface for a physics-enabled object
+     * @see https://doc.babylonjs.com/how_to/using_the_physics_engine
      */
      */
     export interface IPhysicsEnabledObject {
     export interface IPhysicsEnabledObject {
         /**
         /**
@@ -133,6 +135,7 @@ module BABYLON {
 
 
     /**
     /**
      * Represents a physics imposter
      * Represents a physics imposter
+     * @see https://doc.babylonjs.com/how_to/using_the_physics_engine
      */
      */
     export class PhysicsImpostor {
     export class PhysicsImpostor {
 
 

+ 13 - 4
src/Physics/babylon.physicsJoint.ts

@@ -2,6 +2,7 @@ module BABYLON {
 
 
     /**
     /**
      * Interface for Physics-Joint data
      * Interface for Physics-Joint data
+     * @see https://doc.babylonjs.com/how_to/using_the_physics_engine
      */
      */
     export interface PhysicsJointData {
     export interface PhysicsJointData {
         //Important for some engines, optional!
         //Important for some engines, optional!
@@ -32,8 +33,9 @@ module BABYLON {
     }
     }
 
 
     /**
     /**
-     * This is a holder class for the physics joint created by the physics plugin.
-     * It holds a set of functions to control the underlying joint.
+     * This is a holder class for the physics joint created by the physics plugin
+     * It holds a set of functions to control the underlying joint
+     * @see https://doc.babylonjs.com/how_to/using_the_physics_engine
      */
      */
     export class PhysicsJoint {
     export class PhysicsJoint {
 
 
@@ -86,7 +88,7 @@ module BABYLON {
         /**
         /**
          * Execute a function that is physics-plugin specific.
          * Execute a function that is physics-plugin specific.
          * @param {Function} func the function that will be executed. 
          * @param {Function} func the function that will be executed. 
-         *                        It accepts two parameters: the physics world and the physics joint.
+         *                        It accepts two parameters: the physics world and the physics joint
          */
          */
         public executeNativeFunction(func: (world: any, physicsJoint: any) => void) {
         public executeNativeFunction(func: (world: any, physicsJoint: any) => void) {
             func(this._physicsPlugin.world, this._physicsJoint)
             func(this._physicsPlugin.world, this._physicsJoint)
@@ -148,7 +150,8 @@ module BABYLON {
     }
     }
 
 
     /**
     /**
-     * A class representing a physics distance joint.
+     * A class representing a physics distance joint
+     * @see https://doc.babylonjs.com/how_to/using_the_physics_engine
      */
      */
     export class DistanceJoint extends PhysicsJoint {
     export class DistanceJoint extends PhysicsJoint {
         /**
         /**
@@ -171,6 +174,7 @@ module BABYLON {
 
 
     /**
     /**
      * Represents a Motor-Enabled Joint
      * Represents a Motor-Enabled Joint
+     * @see https://doc.babylonjs.com/how_to/using_the_physics_engine
      */
      */
     export class MotorEnabledJoint extends PhysicsJoint implements IMotorEnabledJoint {
     export class MotorEnabledJoint extends PhysicsJoint implements IMotorEnabledJoint {
 
 
@@ -206,6 +210,7 @@ module BABYLON {
 
 
     /**
     /**
      * This class represents a single physics Hinge-Joint
      * This class represents a single physics Hinge-Joint
+     * @see https://doc.babylonjs.com/how_to/using_the_physics_engine
      */
      */
     export class HingeJoint extends MotorEnabledJoint {
     export class HingeJoint extends MotorEnabledJoint {
 
 
@@ -240,6 +245,7 @@ module BABYLON {
 
 
     /**
     /**
      * This class represents a dual hinge physics joint (same as wheel joint)
      * This class represents a dual hinge physics joint (same as wheel joint)
+     * @see https://doc.babylonjs.com/how_to/using_the_physics_engine
      */
      */
     export class Hinge2Joint extends MotorEnabledJoint {
     export class Hinge2Joint extends MotorEnabledJoint {
 
 
@@ -276,6 +282,7 @@ module BABYLON {
 
 
     /**
     /**
      * Interface for a motor enabled joint
      * Interface for a motor enabled joint
+     * @see https://doc.babylonjs.com/how_to/using_the_physics_engine
      */
      */
     export interface IMotorEnabledJoint {
     export interface IMotorEnabledJoint {
         physicsJoint: any;
         physicsJoint: any;
@@ -285,6 +292,7 @@ module BABYLON {
 
 
     /**
     /**
      * Joint data for a Distance-Joint
      * Joint data for a Distance-Joint
+     * @see https://doc.babylonjs.com/how_to/using_the_physics_engine
      */
      */
     export interface DistanceJointData extends PhysicsJointData {
     export interface DistanceJointData extends PhysicsJointData {
         /**
         /**
@@ -297,6 +305,7 @@ module BABYLON {
 
 
     /**
     /**
      * Joint data from a spring joint
      * Joint data from a spring joint
+     * @see https://doc.babylonjs.com/how_to/using_the_physics_engine
      */
      */
     export interface SpringJointData extends PhysicsJointData {
     export interface SpringJointData extends PhysicsJointData {
         /**
         /**