![]() |
EasyRoads3D V3 Manual | ![]() |
![]() |
![]() |
![]() |
|
ERRoad Description This is the base class for an EasyRoads3D road object
Constructors ...
Functions
public void AddMarker(Vector3 position) Adds a new marker
public void AddMarkers(Vector3[] pos) Adds new markers according an array of Vector3 positions
public ERConnection AttachToEnd(ERConnection connectionPrefab, int connectionIndex) Instantiates and connects a new ERConnection object according the connectionPrefab to the connection connectionIndex at the end of the road. Returns null in the case a connection is already connected to the end or when connectionPrefab is not a valid connection object.
public ERConnection AttachToStart(ERConnection connectionPrefab, int connectionIndex) Instantiates and connects a new ERConnection object according the connectionPrefab to the connection connectionIndex at the start of the road. Returns null in the case the new connection object could not be created because a connection is already connected to the start or when connectionPrefab is not a valid connection object.
public bool ClampUVs(bool value) Generate UVs clamped to 0 at start and 1 at end. This is by default the case. Setting this to false is for example useful for never ending roads created at runtime where markers behind the cam are removed. The UVs at the new start will be generated relative to the same decimal value as for the previous road update.
public bool ClosedTrack(bool value) Activate/deactivate closed track.
public bool IsClosedTrack() Returns the current status of closed track.
public bool ConnectToEnd(ERConnection connectionObject, int connectionIndex) Connects the already exisiting ERConnection connectionObject to the connection connectionIndex at the end of the road. Returns false in the case a connection is already connected to the start or when connectionObject is not a valid connection object.
public bool ConnectToStart(ERConnection connectionObject, int connectionIndex) Connects the already exisiting ERConnection connectionObject to the connection connectionIndex at the start of the road. Returns false in the case a connection is already connected to the start or when connectionObject is not a valid connection object.
public void DeleteMarker(int index) Deleted the marker at the passed index
public bool FollowTerrainContours(bool value) Adjust the shape of the road to the terrain shape. The terrain will still be adjusted according the indent and surrounding values.
public bool FollowTerrainContours(int markerIndex, bool value) Adjusts the status of "Follow Terrain Contours" for the passed marker index.
public bool Destroy() Removes the road object
public float GetAngleThreshold() Returns the Angle Threshold of the road object
public ERConnection GetConnectionAtEnd() Returns the crossing/connection at the end of the road
public ERConnection GetConnectionAtEnd(out int index) Returns the crossing/connection at the end of the road, index holds the connection index
public ERConnection GetConnectionAtStart() Returns the crossing/connection at the start of the road
public ERConnection GetConnectionAtStart(out int index) Returns the crossing/connection at the start of the road, index holds the connection index
public float GetDistance() Returns the distance of the road object
public float GetDistance(int markerIndex) Returns the distance of the section at markerIndex
public Vector3 GetMarkerCount() Returns the total number of markers
public Vector3 GetMarkerPosition(int index) Returns the position of the marker at index
public Vector3[] GetMarkerPositions() Returns all marker positions
public string GetName() Returns the name of the road object
public Vector3 GetPosition(float value, ref int currentElement) Returns the center position of the road at distance value. currentElement can be used for performance optimization.
public Vector3 GetMarkerTilting(int index) Returns the tilting value of the marker at index
public Vector3 GetMarkerTiltingCenter(int index) Returns the tilting center of the marker at index
public float GetResolution() Returns the resolution of the road object
public Vector2[] GetRoadShapeNodes() Returns the global roadshape node data in a Vector2[]
public ERRoadType GetRoadType() Returns the road type
public Vector3[] GetSplinePointsCenter() Returns pre-sampled positions at the center of the road
public Vector3[] GetSplinePointsRightSide() Returns pre-sampled positions at the right side of the road
public Vector3[] GetSplinePointsLeftSide() Returns pre-sampled positions at the left side of the road
public Vector3[] GetSplineStrength(int index) Returns the spline strength of the marker at index.
public Color GetVertexColor(int index) Returns the vertex color of the marker at index.
public float GetWidth() Returns the width of the road object
public void InsertConnector(ERConnection connectionObject, int index, int connectionIndex1, int connectionIndex2, out ERRoad road) Splits the road in two sections and Inserts the connectionObject at marker index to connectionIndex1 and connects the second section to connectionIndex2
public void InsertMarker(Vector3 pos) Inserts a new marker before the selected marker
public void InsertMarkerAt(Vector3 pos, int index) Inserts a new marker before the passed index
public ERRoad InsertIConnector(int index, string connectionName, out ERConnection connection) Inserts an I Connector at marker index. connectionName will be assigned as the connection name and the new connection object will be assigned to connection. If this index is not at the start or end of the road, the road object will be cut and the newly created road will be returned.
public ERRoad InsertIConnector(int index) Inserts an I Connector at marker index. If this index is not at the start or end of the road, the road object will be cut and the newly created road will be returned.
public void IsSideObject(bool value) Marks the road object as a side object, no road mesh will be created
public void IsStatic(bool value) Marks the road object as static/none static
public void FollowTerrainContourThreshold(float value) The contour threshold value controls the smoothness, how accurately the road should follow the terrain slopes
public float SetIndent( float value, int index) This will set the indent value on both the left and right side of the road for the marker at index. The value will be adjusted and returned should the passed value be lower then the minimum required indent value.
public float SetIndent( float value, int index, ERRoadSide type) This will set the indent value marker at index on the left side (ERRoadSide.Left), on the right side (ERRoadSide.Both) or on both sides (ERRoadSide.Both). The value will be adjusted and returned should the passed value be lower then the minimum required indent value.
public float SetIndentAlignment(ERIndentAlignment value, int index, ERRoadSide type) This will set the alignment of the indent position marker at index. By default the indent position is aligned with the road (ERIndentAlignment.Road). Other options are the terrain height at the indent position (ERIndentAlignment.Terrain) or the terrain height at the surrounding poisition (ERIndentAlignment.Surrounding). This can be set for the left side of the road (ERRoadSide.Left), the right side (ERRoadSide.Right) or both sides ((ERRoadSide.Both).
public void SetLayer(int index) Sets the layer of the road game object to index
public bool SetMarkerControlType(int index, ERMarkerControlType type) Sets the ERMarkerControlType type for the marker at index. Enum options are: Spline, StraightXZ, StraightXZY, Circular
public void SetMarkerPosition(int index, Vector3 position) This will update the marker position at index to position
public void SetMarkerPositions(Vector3[] positions) This will update all marker positions provided that the passed array length matches the markers length
public void SetMarkerPositions(Vector3[] positions, int index) This will update all marker positions corresponding to the passed array length starting at index
public void SetMarkerTilting(float value, int index) This will set the tilting level of the marker at index. Value represents the tilting angle
public void SetMarkerTiltingCenter(float value, int index) This will set the tilting center of the marker at index. value represents the position between the left and the right side of the road (0..1)
public void SetMaterial(Material mat) This will assign the passed material to the road. It is recommended to use road types which includes the road material
public void SetMeshCollider(bool value) Adds or removes the mesh collider
public void SetName(string name) Updates the name of the road object
public void SetResolution(float res) Set the resolution of the road object
public float SetSideObjectOffset(SideObject obj, int index, OffsetPosition position, float value) This will start / end the side object obj at marker index at position (OffsetPosition.Start or OffsetPosition.End) according the passed value
public float SetSurrounding(float value, int index) This will set the surrounding value on both the left and right side of the road for the marker at index.
public float SetSurrounding(float value, int index, ERRoadSide type) This will set the surrounding value marker at index on the left side (ERRoadSide.Left), on the right side (ERRoadSide.Both) or on both sides (ERRoadSide.Both).
public void SetAngleThreshold(float res) Set the Angle Threshold of the road object
public void SetRoadShapeNodes(int markerIndex, Vector2[] nodes) Updates the road shape for the section at markerIndex according the passed Vector2[] node data
public void SetRoadShapeNodes(int[] markerIndexes, Vector2[] nodes) Updates the road shape for the section for all passed markerIndexes according the passed Vector2[] node data
public void SetRoadType(ERRoadType rt) This will update the full road to match the passed road type
public void SetSplatmap(bool active) This will blend the road shape in the terrain splatmap
public void SetSplatmap(bool active, int splatIndex , int expand, int smoothLevel, float opacity) This will blend the road shape in the terrain splatmap. Additionally the splatmap parameters will be passed for the terrain splat texture index, width expansion, smooth level and opacity
public void SetSplineStrength(int index, float strength) Sets the spline strength of the marker at index.
public void SetTerrainDeformation(bool value) Toggles on/off terrain deformation for this road according the passed value.
public void SetTerrainDeformation(int markerIndex, bool value) Toggles on/off terrain deformation for markerIndex. This requires Refresh()
public void SetWidth(float width) Sets the width of the road object. It is recommended to use road types which includes the width.
public void SetVertexColor(int index, Color color) Sets the vertex color of the marker at index.
public void SideObjectSetActive(SideObject obj, bool value) This activates / deactivates side object obj, on this road according value.
public void SideObjectMarkerSetActive(SideObject obj, int markerIndex, bool value) This activates / deactivates side object obj, on this road for the marker at markerIndex according value.
public void SideObjectMarkerSetActive(SideObject obj, int[] markerIndexes, bool value) This activates / deactivates side object obj, on this road for all markers in the array markerIndexes according value.
public void SnapToTerrain(bool value) When active, road vertices will snap to the terrain. No terrain deformation will take place for this road object.
public void SnapToTerrain(bool value, float value) When active, road vertices will snap to the terrain with an offset value. No terrain deformation will take place for this road object.
public ERRoad SplitRoad(int markerIndex) This will split the road at markerIndexes and return the newly created ERRoad object.
public void UnConnectEnd() Removes the connection at the end of the road object.
public void UnConnectStart() Removes the connection at the start of the road object.
|
|
![]() |
![]() |