public class CollisionCategory extends Object implements Nameable
CollisionGroup
(and their associated CollisionFormula
).
Here a definition example:
<lionengine:category name="leg_right" axis="Y" x="6" y="0"> <lionengine:group>block</lionengine:group> </lionengine:category> <lionengine:category name="leg_left" axis="Y" x="-6" y="0"> <lionengine:group>block</lionengine:group> </lionengine:category> <lionengine:category name="knee_right" axis="X" x="6" y="0"> <lionengine:group>block</lionengine:group> </lionengine:category> <lionengine:category name="knee_left" axis="X" x="-6" y="0"> <lionengine:group>block</lionengine:group> </lionengine:category>
This will define 4 collision points (for ground collision and their borders, plus vertical elements for horizontal collision).
CollisionCategoryConfig
,
CollisionFormula
Constructor and Description |
---|
CollisionCategory(String name,
Axis axis,
int x,
int y,
Collection<CollisionGroup> groups)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
Axis |
getAxis()
Get the designated axis to use.
|
Collection<CollisionFormula> |
getFormulas()
Get the list of collision formulas to test.
|
Collection<CollisionGroup> |
getGroups()
Get the defined groups.
|
String |
getName() |
int |
getOffsetX()
Get the horizontal offset relative to owner for collision checking.
|
int |
getOffsetY()
Get the vertical offset relative to owner for collision checking.
|
public CollisionCategory(String name, Axis axis, int x, int y, Collection<CollisionGroup> groups)
name
- The category name.axis
- The designated axis to apply collision.x
- The horizontal offset.y
- The vertical offset.groups
- The collision groups used.public Collection<CollisionGroup> getGroups()
public Collection<CollisionFormula> getFormulas()
public Axis getAxis()
public int getOffsetX()
public int getOffsetY()
Copyright © 2016 Byron 3D Games Studio. All rights reserved.