mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-01 07:42:38 +08:00
@@ -274,12 +274,12 @@ export interface IMeshStruct {
|
||||
/**
|
||||
* The min position of this mesh's vertices.
|
||||
*/
|
||||
minPosition: Vec3;
|
||||
minPosition?: Vec3;
|
||||
|
||||
/**
|
||||
* The max position of this mesh's vertices.
|
||||
*/
|
||||
maxPosition: Vec3;
|
||||
maxPosition?: Vec3;
|
||||
}
|
||||
|
||||
// for raycast purpose
|
||||
@@ -391,8 +391,6 @@ export class Mesh extends Asset {
|
||||
this._struct = {
|
||||
vertexBundles: [],
|
||||
primitives: [],
|
||||
minPosition: new Vec3(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE),
|
||||
maxPosition: new Vec3(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ export class RenderableComponent extends Component {
|
||||
return null;
|
||||
}
|
||||
|
||||
const instantiated = Material.getInstantiatedMaterial(this._materials[idx], this);
|
||||
const instantiated = Material.getInstantiatedMaterial(this._materials[idx]!, this);
|
||||
if (instantiated !== this._materials[idx]) {
|
||||
this.setMaterial(instantiated, idx);
|
||||
}
|
||||
|
||||
@@ -129,8 +129,8 @@ export function createMesh (geometry: IGeometry) {
|
||||
const meshStruct: IMeshStruct = {
|
||||
vertexBundles: [vertexBundle],
|
||||
primitives: [primitive],
|
||||
minPosition: new Vec3(geometry.minPos.x, geometry.minPos.y, geometry.minPos.z),
|
||||
maxPosition: new Vec3(geometry.maxPos.x, geometry.maxPos.y, geometry.maxPos.z),
|
||||
minPosition: geometry.minPos && new Vec3(geometry.minPos.x, geometry.minPos.y, geometry.minPos.z),
|
||||
maxPosition: geometry.maxPos && new Vec3(geometry.maxPos.x, geometry.maxPos.y, geometry.maxPos.z),
|
||||
};
|
||||
|
||||
// Create mesh.
|
||||
|
||||
Reference in New Issue
Block a user