本文整理匯總了TypeScript中babylonjs.Nullable類的典型用法代碼示例。如果您正苦於以下問題:TypeScript Nullable類的具體用法?TypeScript Nullable怎麽用?TypeScript Nullable使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了Nullable類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: mesh
public set mesh(value: Nullable<AbstractMesh>) {
if (this._mesh === value) {
return;
}
if (this._mesh && this._meshObserver) {
this._mesh.getScene().onAfterCameraRenderObservable.remove(this._meshObserver);
}
this._mesh = value;
if (this._mesh) {
this._meshObserver = this._mesh.getScene().onAfterCameraRenderObservable.add(this._multiLine.onPointUpdate);
}
this._multiLine._markAsDirty();
}
示例2: debug
public debug(enable: boolean) {
// Draw axis the first time
if (!this._axesViewer) {
this._drawAxis();
}
// Display or hide axis
if (!enable && this._axesViewer) {
let mesh = this._obj as AbstractMesh;
mesh.getScene().onBeforeRenderObservable.remove(this.onBeforeRenderObserver);
this._axesViewer.dispose();
this._axesViewer = null;
}
}
示例3: _translatePoint
private _translatePoint(): Vector2 {
if (this._mesh != null) {
return this._multiLine._host.getProjectedPosition(this._mesh.getBoundingInfo().boundingSphere.center, this._mesh.getWorldMatrix());
}
else if (this._control != null) {
return new Vector2(this._control.centerX, this._control.centerY);
}
else {
var host: any = this._multiLine._host as any;
var xValue: number = this._x.getValueInPixel(host, Number(host._canvas.width));
var yValue: number = this._y.getValueInPixel(host, Number(host._canvas.height));
return new Vector2(xValue, yValue);
}
}