W3cubDocs

/Godot 2.1

Plane

Category: Built-In Types

Brief Description

Plane in hessian form.

Member Functions

Plane Plane ( float a, float b, float c, float d )
Plane Plane ( Vector3 v1, Vector3 v2, Vector3 v3 )
Plane Plane ( Vector3 normal, float d )
Vector3 center ( )
float distance_to ( Vector3 point )
Vector3 get_any_point ( )
bool has_point ( Vector3 point, float epsilon=0.00001 )
Vector3 intersect_3 ( Plane b, Plane c )
Vector3 intersects_ray ( Vector3 from, Vector3 dir )
Vector3 intersects_segment ( Vector3 begin, Vector3 end )
bool is_point_over ( Vector3 point )
Plane normalized ( )
Vector3 project ( Vector3 point )

Member Variables

Description

Plane represents a normalized plane equation. Basically, “normal” is the normal of the plane (a,b,c normalized), and “d” is the distance from the origin to the plane (in the direction of “normal”). “Over” or “Above” the plane is considered the side of the plane towards where the normal is pointing.

Member Function Description

Plane Plane ( float a, float b, float c, float d )

Creates a plane from the three parameters “a”, “b”, “c” and “d”.

Plane Plane ( Vector3 v1, Vector3 v2, Vector3 v3 )

Creates a plane from three points.

Plane Plane ( Vector3 normal, float d )

Creates a plane from the normal and the plane’s distance to the origin.

Vector3 center ( )

Returns the center of the plane.

float distance_to ( Vector3 point )

Returns the shortest distance from the plane to the position “point”.

Vector3 get_any_point ( )

Returns a point on the plane.

bool has_point ( Vector3 point, float epsilon=0.00001 )

Returns true if “point” is inside the plane (by a very minimum threshold).

Vector3 intersect_3 ( Plane b, Plane c )

Returns the intersection point of the three planes “b”, “c” and this plane. If no intersection is found null is returned.

Vector3 intersects_ray ( Vector3 from, Vector3 dir )

Returns the intersection point of a ray consisting of the position “from” and the direction normal “dir” with this plane. If no intersection is found null is returned.

Vector3 intersects_segment ( Vector3 begin, Vector3 end )

Returns the intersection point of a segment from position “begin” to position “end” with this plane. If no intersection is found null is returned.

bool is_point_over ( Vector3 point )

Returns true if “point” is located above the plane.

Plane normalized ( )

Returns a copy of the plane, normalized.

Vector3 project ( Vector3 point )

Returns the orthogonal projection of point “p” into a point in the plane.

© 2014–2017 Juan Linietsky, Ariel Manzur, Godot Engine contributors
Licensed under the MIT License.
http://docs.godotengine.org/en/2.1/classes/class_plane.html