-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add Gizmo custom properties
- Loading branch information
Showing
11 changed files
with
12,231 additions
and
12,028 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { GizmoManager } from '@babylonjs/core/Gizmos/gizmoManager.js'; | ||
|
||
import { CreatedInstance } from '../CreatedInstance'; | ||
import BaseLifecycleListener from './BaseLifecycleListener'; | ||
|
||
export default class GizmoManagerLifecycleListener extends BaseLifecycleListener<GizmoManager, any> { | ||
|
||
onChildAdded(child: CreatedInstance<any>, parent: CreatedInstance<any>): void { | ||
console.log('child added to gizmomanager', child); | ||
const gizmoManager: GizmoManager = parent.hostInstance! as GizmoManager; | ||
// TODO: check usePointerToAttachGizmos? | ||
if (child.metadata && child.metadata.isGizmo !== true) { | ||
console.log('attaching to gizmo manager') | ||
if (child.metadata.isNode === true) { | ||
gizmoManager.attachToNode(child.hostInstance); | ||
} else if (child.metadata.isMesh === true) { | ||
gizmoManager.attachToMesh(child.hostInstance); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.