- Object
-
- Containment
-
- All Implemented Interfaces:
Copyable<Containment>
public class Containment extends Object implements Copyable<Containment>
Represents theContainment
of oneConvex
shape in another.Since the containment test is pair-wise, we can detect whether A is contained by B or B is contained by A in the same detection cycle.
NOTE: The first shape in the detection test is considered A and the second shape is B.- Since:
- 4.2.1
- Version:
- 4.2.1
- Author:
- William Bittle
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
aContainedInB
True if A is contained in Bprotected boolean
bContainedInA
True if B is contained in A
-
Constructor Summary
Constructors Modifier Constructor Description Containment()
Default constructor.protected
Containment(boolean aContainedInB, boolean bContainedInA)
Full constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
Clears the separation information.Containment
copy()
Returns a deep copy of this object.void
copy(Containment containment)
Copies (deep) the givenContainment
information to thisContainment
.boolean
isAContainedInB()
Returns true if A is contained in B.boolean
isBContainedInA()
Returns true if B is contained in A.void
setAContainedInB(boolean flag)
Sets if A is contained in B.void
setBContainedInA(boolean flag)
Sets if B is contained in A.String
toString()
-
-
-
Method Detail
-
clear
public void clear()
Clears the separation information.
-
copy
public void copy(Containment containment)
Copies (deep) the givenContainment
information to thisContainment
.- Parameters:
containment
- the containment to copy
-
copy
public Containment copy()
Description copied from interface:Copyable
Returns a deep copy of this object.- Specified by:
copy
in interfaceCopyable<Containment>
- Returns:
- T
-
isAContainedInB
public boolean isAContainedInB()
Returns true if A is contained in B.- Returns:
- boolean
-
setAContainedInB
public void setAContainedInB(boolean flag)
Sets if A is contained in B.- Parameters:
flag
- true if A is contained in B
-
isBContainedInA
public boolean isBContainedInA()
Returns true if B is contained in A.- Returns:
- boolean
-
setBContainedInA
public void setBContainedInA(boolean flag)
Sets if B is contained in A.- Parameters:
flag
- true if B is contained in A
-
-