◆ Sphere() [1/3]
pluginbase.Helpers.Geometry.Sphere.Sphere |
( |
Sphere |
sphere | ) |
|
13 this.
Point = sphere.Point;
14 this.
Radius = sphere.Radius;
Vector3d Point
Definition: Sphere.cs:8
double Radius
Definition: Sphere.cs:9
◆ Sphere() [2/3]
pluginbase.Helpers.Geometry.Sphere.Sphere |
( |
Vector3d |
point, |
|
|
double |
radius |
|
) |
| |
Vector3d Point
Definition: Sphere.cs:8
double Radius
Definition: Sphere.cs:9
◆ Sphere() [3/3]
pluginbase.Helpers.Geometry.Sphere.Sphere |
( |
double |
x, |
|
|
double |
y, |
|
|
double |
z, |
|
|
double |
radius |
|
) |
| |
25 this.
Point =
new Vector3d(x, y, z);
Vector3d Point
Definition: Sphere.cs:8
double Radius
Definition: Sphere.cs:9
◆ Contains()
bool pluginbase.Helpers.Geometry.Sphere.Contains |
( |
Vector3d |
pt | ) |
|
Vector3d Point
Definition: Sphere.cs:8
double Radius
Definition: Sphere.cs:9
◆ Distance()
double pluginbase.Helpers.Geometry.Sphere.Distance |
( |
Vector3d |
pt | ) |
|
44 return (this.
Point - pt).Length;
Vector3d Point
Definition: Sphere.cs:8
◆ Intersects()
bool pluginbase.Helpers.Geometry.Sphere.Intersects |
( |
Ray |
ray, |
|
|
out double |
dist |
|
) |
| |
Implements pluginbase.Helpers.Geometry.IIntersectable.
51 var vpc = this.
Point - ray.Point;
53 if (Vector3d.Dot(vpc, ray.Direction) < 0.0)
56 if (vpc.Length >
this.Radius)
62 Vector3d pc = ray.ProjectPoint(this.
Point);
64 double pcDist = Math.Sqrt(this.
Radius*this.
Radius - pcLen*pcLen);
65 dist = pcDist - (pc - ray.Point).
Length;
69 Vector3d projC = ray.ProjectPoint(this.
Point);
77 double projDist = Math.Sqrt(this.
Radius * this.
Radius - pcToC * pcToC);
79 if (vpc.Length >
this.Radius)
81 dist = (projC - ray.Point).
Length - projDist;
85 dist = (projC - ray.Point).
Length + projDist;
float Length
Definition: Vector2i.cs:129
Vector3d Point
Definition: Sphere.cs:8
double Radius
Definition: Sphere.cs:9
◆ ToString()
override string pluginbase.Helpers.Geometry.Sphere.ToString |
( |
| ) |
|
94 return string.Format(
"[Sphere: Point={0}, Radius={1}]",
Point,
Radius);
Vector3d Point
Definition: Sphere.cs:8
double Radius
Definition: Sphere.cs:9
◆ Point
Vector3d pluginbase.Helpers.Geometry.Sphere.Point |
◆ Radius
double pluginbase.Helpers.Geometry.Sphere.Radius |
◆ Volume
double pluginbase.Helpers.Geometry.Sphere.Volume |
|
get |
The documentation for this struct was generated from the following file: