Browse Source

Cameras documentation

Jason Sturges 4 years ago
parent
commit
6cb4568849

+ 1 - 1
src/Cameras/Inputs/BaseCameraMouseWheelInput.ts

@@ -133,7 +133,7 @@ export abstract class BaseCameraMouseWheelInput implements ICameraInput<Camera>
     }
 
     /**
-     * Gets the class name of the current intput.
+     * Gets the class name of the current input.
      * @returns the class name
      */
     public getClassName(): string {

+ 1 - 1
src/Cameras/Inputs/arcRotateCameraKeyboardMoveInput.ts

@@ -214,7 +214,7 @@ export class ArcRotateCameraKeyboardMoveInput implements ICameraInput<ArcRotateC
     }
 
     /**
-     * Gets the class name of the current intput.
+     * Gets the class name of the current input.
      * @returns the class name
      */
     public getClassName(): string {

+ 1 - 1
src/Cameras/Inputs/arcRotateCameraMouseWheelInput.ts

@@ -116,7 +116,7 @@ export class ArcRotateCameraMouseWheelInput implements ICameraInput<ArcRotateCam
     }
 
     /**
-     * Gets the class name of the current intput.
+     * Gets the class name of the current input.
      * @returns the class name
      */
     public getClassName(): string {

+ 1 - 1
src/Cameras/Inputs/arcRotateCameraVRDeviceOrientationInput.ts

@@ -130,7 +130,7 @@ export class ArcRotateCameraVRDeviceOrientationInput implements ICameraInput<Arc
     }
 
     /**
-     * Gets the class name of the current intput.
+     * Gets the class name of the current input.
      * @returns the class name
      */
     public getClassName(): string {

+ 2 - 2
src/Cameras/Inputs/followCameraMouseWheelInput.ts

@@ -73,7 +73,7 @@ export class FollowCameraMouseWheelInput implements ICameraInput<FollowCamera> {
                                 <number>(<unknown>this.axisControlHeight) +
                                 <number>(<unknown>this.axisControlRotation)) <= 1,
                                "wheelDeltaPercentage only usable when mouse wheel " +
-                               "controlls ONE axis. " +
+                               "controls ONE axis. " +
                                "Currently enabled: " +
                                "axisControlRadius: " + this.axisControlRadius +
                                ", axisControlHeightOffset: " + this.axisControlHeight +
@@ -134,7 +134,7 @@ export class FollowCameraMouseWheelInput implements ICameraInput<FollowCamera> {
     }
 
     /**
-     * Gets the class name of the current intput.
+     * Gets the class name of the current input.
      * @returns the class name
      */
     public getClassName(): string {

+ 1 - 1
src/Cameras/Inputs/freeCameraDeviceOrientationInput.ts

@@ -208,7 +208,7 @@ export class FreeCameraDeviceOrientationInput implements ICameraInput<FreeCamera
     }
 
     /**
-     * Gets the class name of the current intput.
+     * Gets the class name of the current input.
      * @returns the class name
      */
     public getClassName(): string {

+ 1 - 1
src/Cameras/Inputs/freeCameraGamepadInput.ts

@@ -139,7 +139,7 @@ export class FreeCameraGamepadInput implements ICameraInput<FreeCamera> {
     }
 
     /**
-     * Gets the class name of the current intput.
+     * Gets the class name of the current input.
      * @returns the class name
      */
     public getClassName(): string {

+ 1 - 1
src/Cameras/Inputs/freeCameraKeyboardMoveInput.ts

@@ -169,7 +169,7 @@ export class FreeCameraKeyboardMoveInput implements ICameraInput<FreeCamera> {
     }
 
     /**
-     * Gets the class name of the current intput.
+     * Gets the class name of the current input.
      * @returns the class name
      */
     public getClassName(): string {

+ 1 - 1
src/Cameras/Inputs/freeCameraMouseInput.ts

@@ -219,7 +219,7 @@ export class FreeCameraMouseInput implements ICameraInput<FreeCamera> {
     }
 
     /**
-     * Gets the class name of the current intput.
+     * Gets the class name of the current input.
      * @returns the class name
      */
     public getClassName(): string {

+ 1 - 1
src/Cameras/Inputs/freeCameraTouchInput.ts

@@ -190,7 +190,7 @@ export class FreeCameraTouchInput implements ICameraInput<FreeCamera> {
     }
 
     /**
-     * Gets the class name of the current intput.
+     * Gets the class name of the current input.
      * @returns the class name
      */
     public getClassName(): string {

+ 1 - 1
src/Cameras/Inputs/freeCameraVirtualJoystickInput.ts

@@ -106,7 +106,7 @@ export class FreeCameraVirtualJoystickInput implements ICameraInput<FreeCamera>
     }
 
     /**
-     * Gets the class name of the current intput.
+     * Gets the class name of the current input.
      * @returns the class name
      */
     public getClassName(): string {

+ 1 - 1
src/Cameras/VR/vrCameraMetrics.ts

@@ -55,7 +55,7 @@ export class VRCameraMetrics {
      */
     public lensCenterOffset: number;
     /**
-     * Define if the current vr camera should compensate the distortion of the lense or not.
+     * Define if the current vr camera should compensate the distortion of the lens or not.
      */
     public compensateDistortion = true;
 

+ 2 - 2
src/Cameras/VR/vrDeviceOrientationArcRotateCamera.ts

@@ -23,12 +23,12 @@ export class VRDeviceOrientationArcRotateCamera extends ArcRotateCamera {
     /**
      * Creates a new VRDeviceOrientationArcRotateCamera
      * @param name defines camera name
-     * @param alpha defines the camera rotation along the logitudinal axis
+     * @param alpha defines the camera rotation along the longitudinal axis
      * @param beta defines the camera rotation along the latitudinal axis
      * @param radius defines the camera distance from its target
      * @param target defines the camera target
      * @param scene defines the scene the camera belongs to
-     * @param compensateDistortion defines if the camera needs to compensate the lens distorsion
+     * @param compensateDistortion defines if the camera needs to compensate the lens distortion
      * @param vrCameraMetrics defines the vr metrics associated to the camera
      */
     constructor(name: string, alpha: number, beta: number, radius: number, target: Vector3, scene: Scene, compensateDistortion = true, vrCameraMetrics: VRCameraMetrics = VRCameraMetrics.GetDefault()) {

+ 1 - 1
src/Cameras/VR/vrDeviceOrientationFreeCamera.ts

@@ -23,7 +23,7 @@ export class VRDeviceOrientationFreeCamera extends DeviceOrientationCamera {
      * @param name defines camera name
      * @param position defines the start position of the camera
      * @param scene defines the scene the camera belongs to
-     * @param compensateDistortion defines if the camera needs to compensate the lens distorsion
+     * @param compensateDistortion defines if the camera needs to compensate the lens distortion
      * @param vrCameraMetrics defines the vr metrics associated to the camera
      */
     constructor(name: string, position: Vector3, scene: Scene, compensateDistortion = true, vrCameraMetrics: VRCameraMetrics = VRCameraMetrics.GetDefault()) {

+ 1 - 1
src/Cameras/VR/vrDeviceOrientationGamepadCamera.ts

@@ -21,7 +21,7 @@ export class VRDeviceOrientationGamepadCamera extends VRDeviceOrientationFreeCam
      * @param name defines camera name
      * @param position defines the start position of the camera
      * @param scene defines the scene the camera belongs to
-     * @param compensateDistortion defines if the camera needs to compensate the lens distorsion
+     * @param compensateDistortion defines if the camera needs to compensate the lens distortion
      * @param vrCameraMetrics defines the vr metrics associated to the camera
      */
     constructor(name: string, position: Vector3, scene: Scene, compensateDistortion = true, vrCameraMetrics: VRCameraMetrics = VRCameraMetrics.GetDefault()) {

+ 2 - 2
src/Cameras/VR/vrExperienceHelper.ts

@@ -474,12 +474,12 @@ export class VRExperienceHelper {
     private _raySelectionPredicate: (mesh: AbstractMesh) => boolean;
 
     /**
-     * To be optionaly changed by user to define custom ray selection
+     * To be optionally changed by user to define custom ray selection
      */
     public raySelectionPredicate: (mesh: AbstractMesh) => boolean;
 
     /**
-     * To be optionaly changed by user to define custom selection logic (after ray selection)
+     * To be optionally changed by user to define custom selection logic (after ray selection)
      */
     public meshSelectionPredicate: (mesh: AbstractMesh) => boolean;
 

+ 1 - 1
src/Cameras/VR/webVRCamera.ts

@@ -147,7 +147,7 @@ export interface WebVROptions {
     defaultHeight?: number;
 
     /**
-     * If multiview should be used if availible (default: false)
+     * If multiview should be used if available (default: false)
      */
     useMultiview?: boolean;
 }

+ 9 - 9
src/Cameras/arcRotateCamera.ts

@@ -198,13 +198,13 @@ export class ArcRotateCamera extends TargetCamera {
 
     /**
      * Defines the maximum distance the camera can pan.
-     * This could help keeping the cammera always in your scene.
+     * This could help keeping the camera always in your scene.
      */
     @serialize()
     public panningDistanceLimit: Nullable<number> = null;
 
     /**
-     * Defines the target of the camera before paning.
+     * Defines the target of the camera before panning.
      */
     @serializeAsVector3()
     public panningOriginTarget: Vector3 = Vector3.Zero();
@@ -457,7 +457,7 @@ export class ArcRotateCamera extends TargetCamera {
     //-- end properties for backward compatibility for inputs
 
     /**
-     * Defines how much the radius should be scaled while zomming on a particular mesh (through the zoomOn function)
+     * Defines how much the radius should be scaled while zooming on a particular mesh (through the zoomOn function)
      */
     @serialize()
     public zoomOnFactor = 1;
@@ -639,12 +639,12 @@ export class ArcRotateCamera extends TargetCamera {
     /**
      * Instantiates a new ArcRotateCamera in a given scene
      * @param name Defines the name of the camera
-     * @param alpha Defines the camera rotation along the logitudinal axis
+     * @param alpha Defines the camera rotation along the longitudinal axis
      * @param beta Defines the camera rotation along the latitudinal axis
      * @param radius Defines the camera distance from its target
      * @param target Defines the camera target
      * @param scene Defines the scene the camera belongs to
-     * @param setActiveOnSceneIfNoneActive Defines wheter the camera should be marked as active if not other active cameras have been defined
+     * @param setActiveOnSceneIfNoneActive Defines whether the camera should be marked as active if not other active cameras have been defined
      */
     constructor(name: string, alpha: number, beta: number, radius: number, target: Vector3, scene: Scene, setActiveOnSceneIfNoneActive = true) {
         super(name, Vector3.Zero(), scene, setActiveOnSceneIfNoneActive);
@@ -774,20 +774,20 @@ export class ArcRotateCamera extends TargetCamera {
     /**
      * Attached controls to the current camera.
      * @param noPreventDefault Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault)
-     * @param useCtrlForPanning  Defines whether ctrl is used for paning within the controls
+     * @param useCtrlForPanning  Defines whether ctrl is used for panning within the controls
      */
     public attachControl(noPreventDefault: boolean, useCtrlForPanning: boolean): void;
     /**
      * Attached controls to the current camera.
      * @param ignored defines an ignored parameter kept for backward compatibility. If you want to define the source input element, you can set engine.inputElement before calling camera.attachControl
      * @param noPreventDefault Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault)
-     * @param useCtrlForPanning  Defines whether ctrl is used for paning within the controls
+     * @param useCtrlForPanning  Defines whether ctrl is used for panning within the controls
      */
     public attachControl(ignored: any, noPreventDefault: boolean, useCtrlForPanning: boolean): void;
     /**
      * Attached controls to the current camera.
      * @param noPreventDefault Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault)
-     * @param useCtrlForPanning  Defines whether ctrl is used for paning within the controls
+     * @param useCtrlForPanning  Defines whether ctrl is used for panning within the controls
      * @param panningMouseButton Defines whether panning is allowed through mouse click button
      */
     public attachControl(noPreventDefault: boolean, useCtrlForPanning: boolean, panningMouseButton: number): void;
@@ -795,7 +795,7 @@ export class ArcRotateCamera extends TargetCamera {
      * Attached controls to the current camera.
      * @param ignored defines an ignored parameter kept for backward compatibility. If you want to define the source input element, you can set engine.inputElement before calling camera.attachControl
      * @param noPreventDefault Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault)
-     * @param useCtrlForPanning  Defines whether ctrl is used for paning within the controls
+     * @param useCtrlForPanning  Defines whether ctrl is used for panning within the controls
      * @param panningMouseButton Defines whether panning is allowed through mouse click button
      */
     public attachControl(ignored: any, noPreventDefault?: boolean, useCtrlForPanning: boolean | number = true, panningMouseButton: number = 2): void {

+ 8 - 8
src/Cameras/camera.ts

@@ -56,7 +56,7 @@ export class Camera extends Node {
     public static readonly FOVMODE_HORIZONTAL_FIXED = 1;
 
     /**
-     * This specifies ther is no need for a camera rig.
+     * This specifies there is no need for a camera rig.
      * Basically only one eye is rendered corresponding to the camera.
      */
     public static readonly RIG_MODE_NONE = 0;
@@ -244,10 +244,10 @@ export class Camera extends Node {
 
     /**
      * Defines the list of custom render target which are rendered to and then used as the input to this camera's render. Eg. display another camera view on a TV in the main scene
-     * This is pretty helpfull if you wish to make a camera render to a texture you could reuse somewhere
+     * This is pretty helpful if you wish to make a camera render to a texture you could reuse somewhere
      * else in the scene. (Eg. security camera)
      *
-     * To change the final output target of the camera, camera.outputRenderTarget should be used instead (eg. webXR renders to a render target corrisponding to an HMD)
+     * To change the final output target of the camera, camera.outputRenderTarget should be used instead (eg. webXR renders to a render target corresponding to an HMD)
      */
     public customRenderTargets = new Array<RenderTargetTexture>();
     /**
@@ -585,7 +585,7 @@ export class Camera extends Node {
     }
 
     /**
-     * Internal, gets the first post proces.
+     * Internal, gets the first post process.
      * @returns the first post process to be run on this camera.
      */
     public _getFirstPostProcess(): Nullable<PostProcess> {
@@ -872,7 +872,7 @@ export class Camera extends Node {
 
     /**
      * Checks if a cullable object (mesh...) is in the camera frustum
-     * Unlike isInFrustum this cheks the full bounding box
+     * Unlike isInFrustum this checks the full bounding box
      * @param target The object to check
      * @returns true if the object is in frustum otherwise false
      */
@@ -885,7 +885,7 @@ export class Camera extends Node {
     /**
      * Gets a ray in the forward direction from the camera.
      * @param length Defines the length of the ray to create
-     * @param transform Defines the transform to apply to the ray, by default the world matrx is used to create a workd space ray
+     * @param transform Defines the transform to apply to the ray, by default the world matrix is used to create a workd space ray
      * @param origin Defines the start point of the ray which defaults to the camera position
      * @returns the forward ray
      */
@@ -1182,7 +1182,7 @@ export class Camera extends Node {
     }
 
     /**
-     * Serialiaze the camera setup to a json represention
+     * Serialiaze the camera setup to a json representation
      * @returns the JSON representation
      */
     public serialize(): any {
@@ -1255,7 +1255,7 @@ export class Camera extends Node {
      * @param scene The scene the result will construct the camera in
      * @param interaxial_distance In case of stereoscopic setup, the distance between both eyes
      * @param isStereoscopicSideBySide In case of stereoscopic setup, should the sereo be side b side
-     * @returns a factory method to construc the camera
+     * @returns a factory method to construct the camera
      */
     static GetConstructorFromName(type: string, name: string, scene: Scene, interaxial_distance: number = 0, isStereoscopicSideBySide: boolean = true): () => Camera {
         let constructorFunc = Node.Construct(type, name, scene, {

+ 3 - 3
src/Cameras/cameraInputsManager.ts

@@ -19,7 +19,7 @@ export interface ICameraInput<TCamera extends Camera> {
      */
     camera: Nullable<TCamera>;
     /**
-     * Gets the class name of the current intput.
+     * Gets the class name of the current input.
      * @returns the class name
      */
     getClassName(): string;
@@ -65,7 +65,7 @@ export interface CameraInputsMap<TCamera extends Camera> {
  */
 export class CameraInputsManager<TCamera extends Camera> {
     /**
-     * Defines the list of inputs attahed to the camera.
+     * Defines the list of inputs attached to the camera.
      */
     public attached: CameraInputsMap<TCamera>;
 
@@ -93,7 +93,7 @@ export class CameraInputsManager<TCamera extends Camera> {
 
     /**
      * Instantiate a new Camera Input Manager.
-     * @param camera Defines the camera the input manager blongs to
+     * @param camera Defines the camera the input manager belongs to
      */
     constructor(camera: TCamera) {
         this.attached = {};

+ 1 - 1
src/Cameras/flyCamera.ts

@@ -264,7 +264,7 @@ export class FlyCamera extends TargetCamera {
      * @param name Define the name of the camera in the scene.
      * @param position Define the starting position of the camera in the scene.
      * @param scene Define the scene the camera belongs to.
-     * @param setActiveOnSceneIfNoneActive Defines wheter the camera should be marked as active, if no other camera has been defined as active.
+     * @param setActiveOnSceneIfNoneActive Defines whether the camera should be marked as active, if no other camera has been defined as active.
     */
     constructor(name: string, position: Vector3, scene: Scene, setActiveOnSceneIfNoneActive = true) {
         super(name, position, scene, setActiveOnSceneIfNoneActive);

+ 2 - 2
src/Cameras/followCamera.ts

@@ -65,7 +65,7 @@ export class FollowCamera extends TargetCamera {
 
     /**
      * Define a height offset between the camera and the object it follows.
-     * It can help following an object from the top (like a car chaing a plane)
+     * It can help following an object from the top (like a car chasing a plane)
      */
     @serialize()
     public heightOffset: number = 4;
@@ -259,7 +259,7 @@ export class ArcFollowCamera extends TargetCamera {
      * Instantiates a new ArcFollowCamera
      * @see https://doc.babylonjs.com/features/cameras#follow-camera
      * @param name Define the name of the camera
-     * @param alpha Define the rotation angle of the camera around the logitudinal axis
+     * @param alpha Define the rotation angle of the camera around the longitudinal axis
      * @param beta Define the rotation angle of the camera around the elevation axis
      * @param radius Define the radius of the camera from its target point
      * @param target Define the target of the camera

+ 1 - 1
src/Cameras/freeCamera.ts

@@ -213,7 +213,7 @@ export class FreeCamera extends TargetCamera {
      * @param name Define the name of the camera in the scene
      * @param position Define the start position of the camera in the scene
      * @param scene Define the scene the camera belongs to
-     * @param setActiveOnSceneIfNoneActive Defines wheter the camera should be marked as active if not other active cameras have been defined
+     * @param setActiveOnSceneIfNoneActive Defines whether the camera should be marked as active if not other active cameras have been defined
      */
     constructor(name: string, position: Vector3, scene: Scene, setActiveOnSceneIfNoneActive = true) {
         super(name, position, scene, setActiveOnSceneIfNoneActive);

+ 1 - 1
src/Cameras/targetCamera.ts

@@ -106,7 +106,7 @@ export class TargetCamera extends Camera {
      * @param name Defines the name of the camera in the scene
      * @param position Defines the start position of the camera in the scene
      * @param scene Defines the scene the camera belongs to
-     * @param setActiveOnSceneIfNoneActive Defines wheter the camera should be marked as active if not other active cameras have been defined
+     * @param setActiveOnSceneIfNoneActive Defines whether the camera should be marked as active if not other active cameras have been defined
      */
     constructor(name: string, position: Vector3, scene: Scene, setActiveOnSceneIfNoneActive = true) {
         super(name, position, scene, setActiveOnSceneIfNoneActive);

+ 1 - 1
src/Cameras/virtualJoysticksCamera.ts

@@ -18,7 +18,7 @@ Node.AddNodeConstructor("VirtualJoysticksCamera", (name, scene) => {
 export class VirtualJoysticksCamera extends FreeCamera {
 
     /**
-     * Intantiates a VirtualJoysticksCamera. It can be useful in First Person Shooter game for instance.
+     * Instantiates a VirtualJoysticksCamera. It can be useful in First Person Shooter game for instance.
      * It is identical to the Free Camera and simply adds by default a virtual joystick.
      * Virtual Joysticks are on-screen 2D graphics that are used to control the camera or other scene items.
      * @see https://doc.babylonjs.com/features/cameras#virtual-joysticks-camera