Class RnWay
Inheritance
System.Object
RnWay
Implements
IReadOnlyList<Vector3>
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()
Assembly: cs.temp.dll.dll
Syntax
public class RnWay : ARnParts<RnWay>
Constructors
RnWay()
Declaration
RnWay(RnLineString, Boolean, Boolean)
Declaration
public RnWay(RnLineString lineString, bool isReversed = false, bool isReverseNormal = false)
Parameters
| Type |
Name |
Description |
| RnLineString |
lineString |
|
| System.Boolean |
isReversed |
LineStringの向きが逆かどうか
|
| System.Boolean |
isReverseNormal |
法線が進行方向に対して左側か右側か. trueなら右側
|
RnWay(RnWay)
Declaration
public RnWay(RnWay other)
Parameters
| Type |
Name |
Description |
| RnWay |
other |
|
RnWay(RnWay, Boolean)
Declaration
public RnWay(RnWay src, bool cloneVertex = true)
Parameters
| Type |
Name |
Description |
| RnWay |
src |
|
| System.Boolean |
cloneVertex |
|
Properties
Count
Declaration
public int Count { get; }
Property Value
| Type |
Description |
| System.Int32 |
|
IsReversed
Declaration
public bool IsReversed { get; set; }
Property Value
| Type |
Description |
| System.Boolean |
|
IsReverseNormal
Declaration
public bool IsReverseNormal { get; set; }
Property Value
| Type |
Description |
| System.Boolean |
|
IsValid
Declaration
public bool IsValid { get; }
Property Value
| Type |
Description |
| System.Boolean |
|
Item[Int32]
Declaration
public Vector3 this[int index] { get; set; }
Parameters
| Type |
Name |
Description |
| System.Int32 |
index |
|
Property Value
LineString
Declaration
public RnLineString LineString { get; }
Property Value
Points
頂点情報をPoint型で返す(頂点変更できるように)
Declaration
public IEnumerable<RnPoint> Points { get; set; }
Property Value
| Type |
Description |
| IEnumerable<RnPoint> |
|
Vertices
Declaration
public IEnumerable<Vector3> Vertices { get; }
Property Value
| Type |
Description |
| IEnumerable<Vector3> |
|
Methods
Clone(Boolean)
自身のクローンを作成する.
cloneVertexがtrueの時は頂点もクローンする
Declaration
public RnWay Clone(bool cloneVertex)
Parameters
| Type |
Name |
Description |
| System.Boolean |
cloneVertex |
|
Returns
GetEdgeNormal(Int32)
頂点 startVertexIndex, startVertexIndex + 1で構成される辺の法線ベクトルを返す
道の外側を向いている. 正規化済み
Declaration
public Vector3 GetEdgeNormal(int startVertexIndex)
Parameters
| Type |
Name |
Description |
| System.Int32 |
startVertexIndex |
|
Returns
GetEdgeNormals()
Declaration
public IEnumerable<Vector3> GetEdgeNormals()
Returns
| Type |
Description |
| IEnumerable<Vector3> |
|
GetEnumerator()
Declaration
public IEnumerator<Vector3> GetEnumerator()
Returns
| Type |
Description |
| IEnumerator<Vector3> |
|
GetLerpPoint(Single)
Declaration
public Vector3 GetLerpPoint(float p)
Parameters
| Type |
Name |
Description |
| System.Single |
p |
|
Returns
GetLerpPoint(Single, out Vector3)
線分の距離をp : (1-p)で分割した点をmidPointに入れて返す. 戻り値は midPointを含む線分のインデックス(i ~ i+1の線分上にmidPointがある)
Declaration
public float GetLerpPoint(float p, out Vector3 midPoint)
Parameters
| Type |
Name |
Description |
| System.Single |
p |
|
| Vector3 |
midPoint |
|
Returns
| Type |
Description |
| System.Single |
|
GetPoint(Int32)
Declaration
public RnPoint GetPoint(int index)
Parameters
| Type |
Name |
Description |
| System.Int32 |
index |
|
Returns
GetVertexNormal(Int32)
頂点 vertexIndex -> vertexIndex, vertexIndex -> vertexIndex + 1の方向に対して
道の外側を向いている法線ベクトルの平均を返す.正規化済み.
Declaration
public Vector3 GetVertexNormal(int vertexIndex)
Parameters
| Type |
Name |
Description |
| System.Int32 |
vertexIndex |
|
Returns
GetVertexNormals()
Declaration
public IEnumerable<Vector3> GetVertexNormals()
Returns
| Type |
Description |
| IEnumerable<Vector3> |
|
HalfLineIntersectionXz(Ray, out Vector3)
Xz平面だけで見たときの, 半直線rayの最も近い交点を返す
Declaration
public bool HalfLineIntersectionXz(Ray ray, out Vector3 intersection)
Parameters
| Type |
Name |
Description |
| Ray |
ray |
|
| Vector3 |
intersection |
|
Returns
| Type |
Description |
| System.Boolean |
|
IsSameLineReference(RnWay)
Declaration
public bool IsSameLineReference(RnWay other)
Parameters
| Type |
Name |
Description |
| RnWay |
other |
|
Returns
| Type |
Description |
| System.Boolean |
|
IsSameLineSequence(RnWay)
Declaration
public bool IsSameLineSequence(RnWay other)
Parameters
| Type |
Name |
Description |
| RnWay |
other |
|
Returns
| Type |
Description |
| System.Boolean |
|
IsSameLineSequenceReverse(RnWay)
Declaration
public bool IsSameLineSequenceReverse(RnWay other)
Parameters
| Type |
Name |
Description |
| RnWay |
other |
|
Returns
| Type |
Description |
| System.Boolean |
|
Move(Vector3)
Declaration
public void Move(Vector3 offset)
Parameters
| Type |
Name |
Description |
| Vector3 |
offset |
|
MoveAlongNormal(Single)
Declaration
public void MoveAlongNormal(float offset)
Parameters
| Type |
Name |
Description |
| System.Single |
offset |
|
RemoveIntersection()
線が自分自身の線と交差する場合、交差して輪になった部分をなかったことにして交差しないようにします
Declaration
public void RemoveIntersection()
Reverse(Boolean)
Declaration
public void Reverse(bool keepNormalDir)
Parameters
| Type |
Name |
Description |
| System.Boolean |
keepNormalDir |
法線の向きは保持する
|
ReversedWay()
Declaration
public RnWay ReversedWay()
Returns
SegmentIntersectionXz(Vector3, Vector3, out Vector3)
Xz平面だけで見たときの, 線分(st, en)との最も近い交点を返す
Declaration
public bool SegmentIntersectionXz(Vector3 st, Vector3 en, out Vector3 intersection)
Parameters
| Type |
Name |
Description |
| Vector3 |
st |
|
| Vector3 |
en |
|
| Vector3 |
intersection |
|
Returns
| Type |
Description |
| System.Boolean |
|
SetPoint(Int32, RnPoint)
Declaration
public RnPoint SetPoint(int index, RnPoint p)
Parameters
| Type |
Name |
Description |
| System.Int32 |
index |
|
| RnPoint |
p |
|
Returns
SetPointsKeepReference(IEnumerable<Vector3>)
点の座標をまとめて設定する。RnPointへの参照はなるべく保持する。Wayの向きを考慮する。
引数nextPointsの点の数が現在の点と同じであれば、すべてのRnPointへの参照を保つ。
しかし、引数の点の数が現在の点の数と違う場合は、最初と最後のみ参照を保つ。
Declaration
public void SetPointsKeepReference(IEnumerable<Vector3> nextPointsArg)
Parameters
| Type |
Name |
Description |
| IEnumerable<Vector3> |
nextPointsArg |
|
SetPointsUnkeepReference(IEnumerable<Vector3>)
点の座標をまとめて設定する。RnPointを新たに生成するため、既存のRnPointへの参照は途切れる。Wayの向きを考慮する。
Declaration
public void SetPointsUnkeepReference(IEnumerable<Vector3> nextPointsArg)
Parameters
| Type |
Name |
Description |
| IEnumerable<Vector3> |
nextPointsArg |
|
ShallowClone()
自身の浅いコピーを返す(LineStringの参照などはそのまま
Declaration
public RnWay ShallowClone()
Returns
Split(Int32, Boolean, Func<Int32, Single>)
自身をnum分割して返す. 分割できない(頂点空)の時は空リストを返す.
insertNewPoint=trueの時はselfにも新しい点を追加する
Declaration
public List<RnWay> Split(int num, bool insertNewPoint, Func<int, float> rateSelector = null)
Parameters
| Type |
Name |
Description |
| System.Int32 |
num |
|
| System.Boolean |
insertNewPoint |
|
| Func<System.Int32, System.Single> |
rateSelector |
|
Returns
| Type |
Description |
| List<RnWay> |
|
SwitchIndex(Int32)
IsReversed ? Count - 1 - index : index
LineStringとWayのインデックスの相互変換
Declaration
public int SwitchIndex(int index)
Parameters
| Type |
Name |
Description |
| System.Int32 |
index |
|
Returns
| Type |
Description |
| System.Int32 |
|
SwitchIndex(Single)
IsReversed ? Count - 1 - index : index
LineStringとWayのインデックスの相互変換(float版)
Declaration
public float SwitchIndex(float index)
Parameters
| Type |
Name |
Description |
| System.Single |
index |
|
Returns
| Type |
Description |
| System.Single |
|
Implements
IReadOnlyList<>