Restored cutscene code
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
#include "entity/component/display/entityposition.h"
|
||||
#include "entity/component/display/entityrenderable.h"
|
||||
#include "entity/component/physics/entityphysics.h"
|
||||
#include "entity/component/trigger/entitytrigger.h"
|
||||
#include "display/color.h"
|
||||
|
||||
errorret_t entityPrefabPlayerApply(
|
||||
@@ -37,5 +38,17 @@ errorret_t entityPrefabPlayerApply(
|
||||
entityPhysicsSetBodyType(mgr, entityId, physComp, PHYSICS_BODY_DYNAMIC);
|
||||
entityPhysicsSetCollideMask(mgr, entityId, physComp, 0x3);
|
||||
|
||||
// Interact box: a little larger than the player's own body, so nearby
|
||||
// interactable entities overlap it without needing to touch the player
|
||||
// exactly (see entityPlayerTryInteract()).
|
||||
componentid_t interactComp = entityAddComponent(
|
||||
mgr, entityId, COMPONENT_TYPE_TRIGGER
|
||||
);
|
||||
physicsshape_t interactShape = {
|
||||
.type = PHYSICS_SHAPE_CUBE,
|
||||
.data.cube.halfExtents = { 1.0f, 1.0f, 1.0f }
|
||||
};
|
||||
entityTriggerSetShape(mgr, entityId, interactComp, interactShape);
|
||||
|
||||
errorOk();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user