Hi there, so I have a plane entity with a bounding box
var Aabb = pc.createScript('aabb');
// initialize code called once per entity
Aabb.prototype.initialize = function () {
this.aabb = new pc.BoundingBox(new pc.Vec3(3, 1, 2), new pc.Vec3(5, 3, 2));
};
And a model entity
var LoadGlbExternalContainer = pc.createScript('loadGlbExternalContainer');
// initialize code called once per entity
LoadGlbExternalContainer.prototype.initialize = function() {
var app = this.app;
var self = this;
app.assets.loadFromUrlAndFilename('https://threejs.org/examples/models/gltf/Soldier.glb', null, "container", function (err, asset) {
// Add the loaded scene to the hierarchy
self.entity.addComponent('model', {
asset: asset.resource.model
});
self.entity.addComponent('collision', {
type: 'mesh',
asset: asset.resource.model
});
self.entity.addComponent('rigidbody', {
type: pc.BODYTYPE_KINEMATIC
});
if (asset.resource.animations.length > 0) {
self.entity.addComponent('animation', {
assets: asset.resource.animations
});
}
});
};
// update code called every frame
LoadGlbExternalContainer.prototype.update = function(dt) {
};
Is there any way to prevent model from loading if the collision of the model is outside of the bounding box? PlayCanvas | HTML5 Game Engine