Search in sources :

Example 6 with Rotation

use of org.terasology.math.Rotation in project Terasology by MovingBlocks.

the class BlockShapeImpl method getCollisionShape.

@Override
public CollisionShape getCollisionShape(Rotation rot) {
    Rotation simplifiedRot = applySymmetry(rot);
    CollisionShape result = collisionShape.get(simplifiedRot);
    if (result == null && baseCollisionShape != null) {
        result = baseCollisionShape.rotate(simplifiedRot.getQuat4f());
        collisionShape.put(simplifiedRot, result);
    }
    return result;
}
Also used : CollisionShape(org.terasology.physics.shapes.CollisionShape) Rotation(org.terasology.math.Rotation)

Aggregations

Rotation (org.terasology.math.Rotation)6 Side (org.terasology.math.Side)4 Block (org.terasology.world.block.Block)3 BlockUri (org.terasology.world.block.BlockUri)3 CollisionShape (org.terasology.physics.shapes.CollisionShape)1