Skip to content

Commit

Permalink
re-add 'isMesh' metadata. Needed for upcoming 'useHover()' hook to ad…
Browse files Browse the repository at this point in the history
…d ActionManager vs 2D `onPointerEnterObservable`. #55
  • Loading branch information
brianzinn committed Mar 31, 2020
1 parent 421e4ed commit e5a833d
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/CreatedInstance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export interface InstanceMetadataParameter {
isEnvironment?: boolean // to find ground for Teleportation (not using a registry - one time cost)
isTargetable?: boolean // will attach a target props handler
isNode?: boolean; // Camera, Light, TransformNode (Bone) - Used for parenting.
isMesh?: boolean; // needed for hover and adding action manager
isMaterial?: boolean // indicates a custom component created by end-user has been created
isGUI3DControl?: boolean // does not work with 2D
isGUI2DControl?: boolean // does not work with 3D
Expand Down
25 changes: 25 additions & 0 deletions src/generatedCode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2599,6 +2599,7 @@ export class FiberBox implements HasPropsHandlers<FiberMeshProps> {
public static readonly Metadata: CreatedInstanceMetadata = {
"acceptsMaterials": true,
"isNode": true,
"isMesh": true,
"className": "FiberBox"
};
}
Expand Down Expand Up @@ -2727,6 +2728,7 @@ export class FiberTiledBox implements HasPropsHandlers<FiberMeshProps> {
public static readonly Metadata: CreatedInstanceMetadata = {
"acceptsMaterials": true,
"isNode": true,
"isMesh": true,
"className": "FiberTiledBox"
};
}
Expand Down Expand Up @@ -2846,6 +2848,7 @@ export class FiberSphere implements HasPropsHandlers<FiberMeshProps> {
public static readonly Metadata: CreatedInstanceMetadata = {
"acceptsMaterials": true,
"isNode": true,
"isMesh": true,
"className": "FiberSphere"
};
}
Expand Down Expand Up @@ -2943,6 +2946,7 @@ export class FiberDisc implements HasPropsHandlers<FiberMeshProps> {
public static readonly Metadata: CreatedInstanceMetadata = {
"acceptsMaterials": true,
"isNode": true,
"isMesh": true,
"className": "FiberDisc"
};
}
Expand Down Expand Up @@ -3056,6 +3060,7 @@ export class FiberIcoSphere implements HasPropsHandlers<FiberMeshProps> {
public static readonly Metadata: CreatedInstanceMetadata = {
"acceptsMaterials": true,
"isNode": true,
"isMesh": true,
"className": "FiberIcoSphere"
};
}
Expand Down Expand Up @@ -3186,6 +3191,7 @@ export class FiberRibbon implements HasPropsHandlers<FiberMeshProps> {
public static readonly Metadata: CreatedInstanceMetadata = {
"acceptsMaterials": true,
"isNode": true,
"isMesh": true,
"className": "FiberRibbon"
};
}
Expand Down Expand Up @@ -3342,6 +3348,7 @@ export class FiberCylinder implements HasPropsHandlers<FiberMeshProps> {
public static readonly Metadata: CreatedInstanceMetadata = {
"acceptsMaterials": true,
"isNode": true,
"isMesh": true,
"className": "FiberCylinder"
};
}
Expand Down Expand Up @@ -3439,6 +3446,7 @@ export class FiberTorus implements HasPropsHandlers<FiberMeshProps> {
public static readonly Metadata: CreatedInstanceMetadata = {
"acceptsMaterials": true,
"isNode": true,
"isMesh": true,
"className": "FiberTorus"
};
}
Expand Down Expand Up @@ -3552,6 +3560,7 @@ export class FiberTorusKnot implements HasPropsHandlers<FiberMeshProps> {
public static readonly Metadata: CreatedInstanceMetadata = {
"acceptsMaterials": true,
"isNode": true,
"isMesh": true,
"className": "FiberTorusKnot"
};
}
Expand Down Expand Up @@ -3642,6 +3651,7 @@ export class FiberLineSystem implements HasPropsHandlers<FiberMeshProps> {
public static readonly Metadata: CreatedInstanceMetadata = {
"acceptsMaterials": true,
"isNode": true,
"isMesh": true,
"className": "FiberLineSystem"
};
}
Expand Down Expand Up @@ -3731,6 +3741,7 @@ export class FiberLines implements HasPropsHandlers<FiberMeshProps> {
public static readonly Metadata: CreatedInstanceMetadata = {
"acceptsMaterials": true,
"isNode": true,
"isMesh": true,
"className": "FiberLines"
};
}
Expand Down Expand Up @@ -3826,6 +3837,7 @@ export class FiberDashedLines implements HasPropsHandlers<FiberMeshProps> {
public static readonly Metadata: CreatedInstanceMetadata = {
"acceptsMaterials": true,
"isNode": true,
"isMesh": true,
"className": "FiberDashedLines"
};
}
Expand Down Expand Up @@ -3948,6 +3960,7 @@ export class FiberExtrudeShape implements HasPropsHandlers<FiberMeshProps> {
public static readonly Metadata: CreatedInstanceMetadata = {
"acceptsMaterials": true,
"isNode": true,
"isMesh": true,
"className": "FiberExtrudeShape"
};
}
Expand Down Expand Up @@ -4085,6 +4098,7 @@ export class FiberExtrudeShapeCustom implements HasPropsHandlers<FiberMeshProps>
public static readonly Metadata: CreatedInstanceMetadata = {
"acceptsMaterials": true,
"isNode": true,
"isMesh": true,
"className": "FiberExtrudeShapeCustom"
};
}
Expand Down Expand Up @@ -4213,6 +4227,7 @@ export class FiberLathe implements HasPropsHandlers<FiberMeshProps> {
public static readonly Metadata: CreatedInstanceMetadata = {
"acceptsMaterials": true,
"isNode": true,
"isMesh": true,
"className": "FiberLathe"
};
}
Expand Down Expand Up @@ -4338,6 +4353,7 @@ export class FiberTiledPlane implements HasPropsHandlers<FiberMeshProps> {
public static readonly Metadata: CreatedInstanceMetadata = {
"acceptsMaterials": true,
"isNode": true,
"isMesh": true,
"className": "FiberTiledPlane"
};
}
Expand Down Expand Up @@ -4440,6 +4456,7 @@ export class FiberPlane implements HasPropsHandlers<FiberMeshProps> {
public static readonly Metadata: CreatedInstanceMetadata = {
"acceptsMaterials": true,
"isNode": true,
"isMesh": true,
"className": "FiberPlane"
};
}
Expand Down Expand Up @@ -4529,6 +4546,7 @@ export class FiberGround implements HasPropsHandlers<FiberMeshProps> {
public static readonly Metadata: CreatedInstanceMetadata = {
"acceptsMaterials": true,
"isNode": true,
"isMesh": true,
"className": "FiberGround"
};
}
Expand Down Expand Up @@ -4625,6 +4643,7 @@ export class FiberTiledGround implements HasPropsHandlers<FiberMeshProps> {
public static readonly Metadata: CreatedInstanceMetadata = {
"acceptsMaterials": true,
"isNode": true,
"isMesh": true,
"className": "FiberTiledGround"
};
}
Expand Down Expand Up @@ -4740,6 +4759,7 @@ export class FiberGroundFromHeightMap implements HasPropsHandlers<FiberMeshProps
public static readonly Metadata: CreatedInstanceMetadata = {
"acceptsMaterials": true,
"isNode": true,
"isMesh": true,
"className": "FiberGroundFromHeightMap"
};
}
Expand Down Expand Up @@ -4852,6 +4872,7 @@ export class FiberPolygon implements HasPropsHandlers<FiberMeshProps> {
public static readonly Metadata: CreatedInstanceMetadata = {
"acceptsMaterials": true,
"isNode": true,
"isMesh": true,
"className": "FiberPolygon"
};
}
Expand Down Expand Up @@ -4959,6 +4980,7 @@ export class FiberExtrudePolygon implements HasPropsHandlers<FiberMeshProps> {
public static readonly Metadata: CreatedInstanceMetadata = {
"acceptsMaterials": true,
"isNode": true,
"isMesh": true,
"className": "FiberExtrudePolygon"
};
}
Expand Down Expand Up @@ -5088,6 +5110,7 @@ export class FiberTube implements HasPropsHandlers<FiberMeshProps> {
public static readonly Metadata: CreatedInstanceMetadata = {
"acceptsMaterials": true,
"isNode": true,
"isMesh": true,
"className": "FiberTube"
};
}
Expand Down Expand Up @@ -5220,6 +5243,7 @@ export class FiberPolyhedron implements HasPropsHandlers<FiberMeshProps> {
public static readonly Metadata: CreatedInstanceMetadata = {
"acceptsMaterials": true,
"isNode": true,
"isMesh": true,
"className": "FiberPolyhedron"
};
}
Expand Down Expand Up @@ -5301,6 +5325,7 @@ export class FiberDecal implements HasPropsHandlers<FiberMeshProps> {
public static readonly Metadata: CreatedInstanceMetadata = {
"acceptsMaterials": true,
"isNode": true,
"isMesh": true,
"className": "FiberDecal"
};
}
Expand Down
3 changes: 2 additions & 1 deletion tools/generate-code.ts
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,8 @@ const createMeshClasses = (generatedCodeSourceFile: SourceFile, generatedPropsSo
createFactoryClass(
'MeshBuilder', 'Mesh', '', {
acceptsMaterials: true,
isNode: true
isNode: true,
isMesh: true
},
generatedCodeSourceFile,
generatedPropsSourceFile
Expand Down

0 comments on commit e5a833d

Please sign in to comment.