本文整理汇总了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);
}
}