Package org.opentrafficsim.core.gtu
Class RelativePosition
- java.lang.Object
 - 
- org.opentrafficsim.core.gtu.RelativePosition
 
 
- 
- All Implemented Interfaces:
 Serializable
public class RelativePosition extends Object implements Serializable
A RelativePosition is a position on a GTU; e.g. the front, rear, position of the driver, etc.
A RelativePosition stores the offset of the position from the reference position of the GTU.Copyright (c) 2013-2022 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.$LastChangedDate$, @version $Revision$, by $Author$, initial version Dec 30, 2014
- Author:
 - Alexander Verbraeck, Peter Knoppers
 - See Also:
 - Serialized Form
 
 
- 
- 
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRelativePosition.TYPEThe type of relative position, e.g., Front, Back, etc. 
- 
Field Summary
Fields Modifier and Type Field Description static RelativePosition.TYPECENTERStandard relative position type CENTER.static RelativePosition.TYPECENTER_GRAVITYCenter of gravity.static RelativePosition.TYPECONTOURStandard relative position type CONTOUR.static RelativePosition.TYPEDRIVERStandard relative position type DRIVER.static RelativePosition.TYPEFRONTStandard relative position type FRONT.static RelativePosition.TYPEREARStandard relative position type BACK.static RelativePosition.TYPEREFERENCEStandard relative position type REFERENCE.static RelativePositionREFERENCE_POSITIONThe reference position (always 0, 0, 0). 
- 
Constructor Summary
Constructors Constructor Description RelativePosition(Length dx, Length dy, Length dz, RelativePosition.TYPE type)RelativePosition(RelativePosition p) 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcalcHashCode()Calculate the hash code once.booleanequals(Object obj)LengthgetDx()LengthgetDy()LengthgetDz()RelativePosition.TYPEgetType()inthashCode()StringtoString() 
 - 
 
- 
- 
Field Detail
- 
FRONT
public static final RelativePosition.TYPE FRONT
Standard relative position type FRONT. 
- 
REAR
public static final RelativePosition.TYPE REAR
Standard relative position type BACK. 
- 
CENTER
public static final RelativePosition.TYPE CENTER
Standard relative position type CENTER. 
- 
REFERENCE
public static final RelativePosition.TYPE REFERENCE
Standard relative position type REFERENCE. 
- 
DRIVER
public static final RelativePosition.TYPE DRIVER
Standard relative position type DRIVER. 
- 
CONTOUR
public static final RelativePosition.TYPE CONTOUR
Standard relative position type CONTOUR. There can be multiple points of type CONTOUR for one GTU. 
- 
CENTER_GRAVITY
public static final RelativePosition.TYPE CENTER_GRAVITY
Center of gravity. 
- 
REFERENCE_POSITION
public static final RelativePosition REFERENCE_POSITION
The reference position (always 0, 0, 0). 
 - 
 
- 
Constructor Detail
- 
RelativePosition
public RelativePosition(Length dx, Length dy, Length dz, RelativePosition.TYPE type)
- Parameters:
 dx- Length; positive x is in the normal direction of movement.dy- Length; positive y is left compared to the normal direction of movement (seen from the top).dz- Length; positive z is up.type- TYPE; type of relative position (FRONT, BACK, etc.).
 
- 
RelativePosition
public RelativePosition(RelativePosition p)
- Parameters:
 p- RelativePosition; a relative position to make a deep copy of.
 
 - 
 
- 
Method Detail
- 
getDx
public final Length getDx()
- Returns:
 - dx.
 
 
- 
getDy
public final Length getDy()
- Returns:
 - dy.
 
 
- 
getDz
public final Length getDz()
- Returns:
 - dz.
 
 
- 
getType
public final RelativePosition.TYPE getType()
- Returns:
 - type.
 
 
- 
calcHashCode
public final int calcHashCode()
Calculate the hash code once.- Returns:
 - the hash code.
 
 
 - 
 
 -