Class RnLaneEx
ROadNetworkLaneの拡張関数
Inheritance
System.Object
RnLaneEx
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: PLATEAU.RoadNetwork.Structure
Assembly: cs.temp.dll.dll
Syntax
public static class RnLaneEx
Methods
CalcMinWidth(RnLane)
このレーンのうち最も狭くなる場所の幅を返す.頂点ごとに計算するため割と重い 左右のレーンが不正の場合は0を返す
Declaration
public static float CalcMinWidth(this RnLane self)
Parameters
| Type | Name | Description |
|---|---|---|
| RnLane | self |
Returns
| Type | Description |
|---|---|
| System.Single |
CalcNextBorderWidth(RnLane)
NextBorderの長さを返す
Declaration
public static float CalcNextBorderWidth(this RnLane self)
Parameters
| Type | Name | Description |
|---|---|---|
| RnLane | self |
Returns
| Type | Description |
|---|---|
| System.Single |
CalcPrevBorderWidth(RnLane)
PrevBorderの長さを返す
Declaration
public static float CalcPrevBorderWidth(this RnLane self)
Parameters
| Type | Name | Description |
|---|---|---|
| RnLane | self |
Returns
| Type | Description |
|---|---|
| System.Single |
CalcWidth(RnLane)
このレーンの幅を返す(Next/PrevBorderの短い方)
Declaration
public static float CalcWidth(this RnLane self)
Parameters
| Type | Name | Description |
|---|---|---|
| RnLane | self |
Returns
| Type | Description |
|---|---|
| System.Single |
GetBorderType(RnLane, RnWay)
Declaration
public static RnLaneBorderType? GetBorderType(this RnLane self, RnWay border)
Parameters
| Type | Name | Description |
|---|---|---|
| RnLane | self | |
| RnWay | border |
Returns
| Type | Description |
|---|---|
| System.Nullable<RnLaneBorderType> |
GetCentralVertex(RnLane)
レーンの中心線っぽい点を返す. 基本はデバッグ用
Declaration
public static Vector3 GetCentralVertex(this RnLane self)
Parameters
| Type | Name | Description |
|---|---|---|
| RnLane | self |
Returns
| Type | Description |
|---|---|
| Vector3 |
GetInnerLerpSegments(RnLane, Single)
selfの左右の道を横幅p : (1-p)で分割した線分を返す. p=[0,1] 例) 0.5だと中央線が返る, 0だとLeftが返る, 1だとRightが返る.
Declaration
public static List<Vector3> GetInnerLerpSegments(this RnLane self, float p2)
Parameters
| Type | Name | Description |
|---|---|---|
| RnLane | self | |
| System.Single | p2 |
Returns
| Type | Description |
|---|---|
| List<Vector3> |
GetVertices(RnLane)
LeftWay -> NextBorder -> RightWay -> PrevBorderの順に頂点を返す
Declaration
public static IEnumerable<RnPoint> GetVertices(this RnLane self)
Parameters
| Type | Name | Description |
|---|---|---|
| RnLane | self |
Returns
| Type | Description |
|---|---|
| IEnumerable<RnPoint> |
SplitLane(RnLane, Int32, Boolean, Func<Int32, Single>)
レーンの分割を行う. withConnectedLinkLaneがtrueの場合は隣接するLinkのLaneも分割する 戻り値 : Key:分割前のレーン, Value:分割後のレーン
Declaration
public static Dictionary<RnLane, List<RnLane>> SplitLane(this RnLane self, int splitNum, bool withConnectedLinkLane, Func<int, float> rateSelector = null)
Parameters
| Type | Name | Description |
|---|---|---|
| RnLane | self | |
| System.Int32 | splitNum | |
| System.Boolean | withConnectedLinkLane | |
| Func<System.Int32, System.Single> | rateSelector | i番目のWayの場所を返す. nullの場合は全て等間隔 |
Returns
| Type | Description |
|---|---|
| Dictionary<RnLane, List<RnLane>> |
SplitLaneSelf(RnLane, Int32)
LaneをsplitNumで分割したLaneリストを返す. 隣接するLinkのLaneは分割しない
Declaration
public static List<RnLane> SplitLaneSelf(this RnLane self, int splitNum)
Parameters
| Type | Name | Description |
|---|---|---|
| RnLane | self | |
| System.Int32 | splitNum |
Returns
| Type | Description |
|---|---|
| List<RnLane> |
TryGetBorderNormal(RnLane, RnWay, out Vector3, out Vector3, out Vector3, out Vector3)
Declaration
public static bool TryGetBorderNormal(this RnLane self, RnWay borderWay, out Vector3 leftPos, out Vector3 leftNormal, out Vector3 rightPos, out Vector3 rightNormal)
Parameters
| Type | Name | Description |
|---|---|---|
| RnLane | self | |
| RnWay | borderWay | |
| Vector3 | leftPos | Laneの外側から見て左側の境界点 |
| Vector3 | leftNormal | Laneの外側から見て左側の境界点の進行方向(Intersection側の方向) |
| Vector3 | rightPos | Laneの外側から見て右側の境界点 |
| Vector3 | rightNormal | Laneの外側から見て右側の境界点の進行方向(Intersection側の方向) |
Returns
| Type | Description |
|---|---|
| System.Boolean |
TrySetWidth(RnLane, Single, LaneWayMoveOption)
Laneの幅を設定する. 頂点ごとに計算するため割と重い
Declaration
public static bool TrySetWidth(this RnLane self, float width, LaneWayMoveOption moveOption)
Parameters
| Type | Name | Description |
|---|---|---|
| RnLane | self | |
| System.Single | width | |
| LaneWayMoveOption | moveOption |
Returns
| Type | Description |
|---|---|
| System.Boolean |