Hello all,
I am trying to create a custom input handler and I have checked out the tutorial (Customize Camera Inputs - Babylon.js Documentation). I am doing the following in TS, but VSCode is highlighting “camera” with the message “Property ‘camera’ has no initializer and is not definitely assigned in the constructor.” The docs say this will get filled in by the input manager, so I didn’t set it explicitly. Did I miss something?
import { Nullable } from "@babylonjs/core/types";
import { FreeCamera } from '@babylonjs/core/Cameras/freeCamera';
import { ICameraInput } from '@babylonjs/core/Cameras/cameraInputsManager';
export class HoverCameraMouseInput implements ICameraInput<FreeCamera>
{
public camera: FreeCamera;
public constructor()
{
}
public getClassName():string
{
return 'HoverCameraMouseInput';
}
public getSimpleName():string
{
return 'hoverInput';
}
public attachControl(element:HTMLElement, preventDefault:boolean):void
{
}
public detachControl(element: Nullable<HTMLElement>)
{
}
public checkInputs():void
{
}
}