AABB
AlignmentBehavior
ArriveBehavior
AStar
BFS
BoundingSphere
BVH
BVHNode
Cell
CellSpacePartitioning
CohesionBehavior
CompositeGoal
ConvexHull
Corridor
CostTable
DFS
Dijkstra
Edge
EntityManager
EvadeBehavior
EventDispatcher
Behavior
FollowPathBehavior
FuzzyAND
FuzzyCompositeTerm
FuzzyFAIRLY
FuzzyModule
FuzzyOR
FuzzyRule
FuzzySet
FuzzyTerm
FuzzyVariable
FuzzyVERY
GameEntity
Goal
GoalEvaluator
Graph
GraphUtils
HalfEdge
HeuristicPolicyDijkstra
HeuristicPolicyEuclid
HeuristicPolicyEuclidSquared
HeuristicPolicyManhattan
InterposeBehavior
LeftSCurveFuzzySet
LeftShoulderFuzzySet
LineSegment
Logger
MathUtils
Matrix3
Matrix4
MemoryRecord
MemorySystem
MeshGeometry
MessageDispatcher
MovingEntity
NavEdge
NavMesh
NavMeshLoader
NavNode
Node
NormalDistFuzzySet
OBB
ObstacleAvoidanceBehavior
OffsetPursuitBehavior
OnPathBehavior
Path
Plane
Polygon
Polyhedron
PriorityQueue
PursuitBehavior
Quaternion
Ray
RectangleTriggerRegion
Regular
RightSCurveFuzzySet
RightShoulderFuzzySet
SAT
SeekBehavior
SeparationBehavior
SingletonFuzzySet
Smoother
SphericalTriggerRegion
State
StateMachine
SteeringBehavior
SteeringManager
Task
TaskQueue
Telegram
Think
Time
TriangularFuzzySet
Trigger
TriggerRegion
Vector3
Vehicle
Version
WanderBehavior

intersectPlane

intersectPlane 是 Plane 类的一个方法,在给定平面的情况下计算该平面与另一个平面的交点,如果两个平面平行,则返回 null。

语法

intersectPlane(plane: Plane): Vector3 | null

参数

  • plane :所要计算相交点的另一个平面,是一个 Plane 类型的实例。

返回值

该方法将返回一个 Vector3 类型的交点,如果两个平面平行,则返回 null。

示例

import { Plane } from 'yuka';

const planeA = new Plane();
planeA.setFromNormalAndCoplanarPoint( new Vector3( 0, 1, 0 ), new Vector3( 0, 0, 0 ) );

const planeB = new Plane();
planeB.setFromNormalAndCoplanarPoint( new Vector3( 0, 1, 0 ), new Vector3( 0, 1, 0 ) );

const intersection = planeA.intersectPlane( planeB ); // null
import { Plane } from 'yuka';

const planeA = new Plane();
planeA.setFromNormalAndCoplanarPoint( new Vector3( -1, 0, 0 ), new Vector3( 0, 0, 0 ) );

const planeB = new Plane();
planeB.setFromNormalAndCoplanarPoint( new Vector3( 0, 1, 0 ), new Vector3( 0, 1, 0 ) );

const intersection = planeA.intersectPlane( planeB ); // Vector3( 0, 0, 0 )

来源

本文档中的 intersectPlane 方法是 Yuka 库中 Plane 类的一个方法。

参考