EasyRoads3D V3 Manual
 

 

ERConnection


Description

This is the base class for an EasyRoads3D connection/crossing between roads.

 

Constructors

...

 

Functions

 

public bool Destroy()

Removes the connection object

 

public int FindNearestConnectionIndex(Vector3 position)

Returns the nearest free connection index to the past Vector3 position. Returns -1 if no connection is available

 

public ERConnectionData[] GetConnectionData()

Returns the currently available connection data of the connection object

 

public Vector3 GetLocalConnectionPosition(int connectionIndex)

Returns the local position of connectionIndex

 

public Vector3[] GetLocalConnectionPositions()

Returns the local positions of all the connections of this connection prefab

 

public string GetName()

Returns the name of the connection object

 

public Vector3 GetConnectionWorldPosition(int connectionIndex)

Returns the world position of connectionIndex

 

public Vector3[] GetConnectionWorldPositions()

Returns the world positions of all the connections of this connection prefab

 

public Vector3[] IConnectorDistance(ERRoad road, float distance)

Creates and sets an actual I Connector mesh according the passed distance on the passed road

 

public Vector3[] IConnectorTransitionMaterial(Material mat)

The MeshRenderer material for the I Connector transition mesh

 

public Vector3[] IConnectorTransition(ERIConnectorTransitionType type)
public Vector3[] IConnectorTransition(ERIConnectorTransitionType type, ERIConnectorTransitionSection section)
public Vector3[] IConnectorTransition(ERIConnectorTransitionType type, ERIConnectorTransitionSection section, float distance, Material mat)

Sets the transition behaviour when an actual I Connector mesh is created.
ERIConnectorTransitionType Options are: None, BlendTextures, tertureTransition
ERIConnectorTransitionSection Options are: None, BlendTextures, tertureTransition. section options are BothRoads, Road1, Road2
distance represents the distance over which the transition will take place when BlendTextures is used for ERIConnectorTransitionType
The Material will be assigned to the IConnector MeshRenderer component

 

public Vector3[] IConnectorTransitionDistance(float distance)

The distance on the I Connector over which the transition will take place

 

public Vector3[] IConnectorTransitionMaterial(Material mat)

The MeshRenderer material for the I Connector transition mesh

 

public void RotateConnections(Vector3 position)

Rotates the crossing and reconnects the attached roads to the new connections. Returns false if the operation could not be completed because of different connection types and the currently attached roads

 

public void SetPosition(Vector3 position)

Updates the position of the connection object

 

public void SetName(string name)

Updates the name of the connection object

 

public void SetRotation(Vector3 euler)

Updates the eulerAngles rotation of the connection object

 

public void SwapTurn()

Swaps the turn between the left and right side of the main road, returns false if the operation could not be completed due to a road already being attached

 

public void UnConnect(int connectionIndex)

Removes the connection with the road object at connectionIndex.