Skip to content

Commit

Permalink
feat(editor): begin "show outline" run test
Browse files Browse the repository at this point in the history
can show one cube's outline;
  • Loading branch information
yyc-git committed Mar 7, 2024
1 parent aefbe36 commit 3c7bd84
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 2 deletions.
11 changes: 10 additions & 1 deletion doc/jiehuo.org
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ TODO add getViewRect, setSelectionObjects to script api

** TODO show outline

TODO fix:
add cube when run->event not work

select one but select all




** TODO pass publish engine

Expand Down Expand Up @@ -90,5 +97,7 @@ TODO remove RayCaster



# ** TODO add MeshRender component
** TODO add MeshRender component

maintain visible

26 changes: 25 additions & 1 deletion utils/meta3d-scenegraph-converter-three-utils/src/Classes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,12 @@ let _getOrCreateDirectionLightInstance = (directionLight: directionLight, gameOb
export class Object3D {
constructor(gameObject: gameObject) {
this.gameObject = gameObject

this._visible = true
}

private _visible: boolean

protected gameObject: gameObject

public get isObject3D(): boolean {
Expand All @@ -234,7 +238,10 @@ export class Object3D {
}

public get visible(): boolean {
return true
return this._visible
}
public set visible(value: boolean) {
this._visible = value
}

public get layers(): LayersType {
Expand Down Expand Up @@ -344,6 +351,19 @@ export class Object3D {
return this.getChildren((gameObject: gameObject) => _createInstance(engineSceneService, meta3dState, gameObject))
}


public traverse(callback) {
callback(this);

const children = this.children;

for (let i = 0, l = children.length; i < l; i++) {

children[i].traverse(callback);

}
}

public onBeforeRender(scene: Scene, camera: Camera, geometry: BufferGeometry, material: MeshPhysicalMaterial, group: any) {
}

Expand Down Expand Up @@ -805,10 +825,14 @@ export class Scene extends Object3D {
public get background(): nullable<ColorType | TextureType | CubeTexture> {
return null
}
public set background(value: nullable<ColorType | TextureType | CubeTexture>) {
}

public get overrideMaterial(): nullable<Material> {
return null
}
public set overrideMaterial(value: nullable<Material>) {
}

public get matrixWorld(): Matrix4Type {
return new Matrix4()
Expand Down

0 comments on commit 3c7bd84

Please sign in to comment.