Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add convenience method PhyiscEngine#recomputeCharacterCollider(entity) #4996

Merged
merged 1 commit into from
Feb 13, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2021 The Terasology Foundation
// Copyright 2022 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0

package org.terasology.engine.physics.engine;
Expand Down Expand Up @@ -238,4 +238,19 @@ public interface PhysicsEngine extends Physics {
* ShapeComponent.
*/
boolean updateTrigger(EntityRef entity);


/**
* Recompute the character collider for the given entity.
*
* The entity must have a {@link org.terasology.engine.logic.location.LocationComponent LocationComponent}
* and a {@link org.terasology.engine.logic.characters.CharacterMovementComponent CharacterMovementComponent}.
*
* @param entity the entity to recompute the character collider for.
* @return the updated character collider of the entity
*/
default CharacterCollider recomputeCharacterCollider(EntityRef entity) {
removeCharacterCollider(entity);
return getCharacterCollider(entity);
}
}