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

fromJSON

简述

fromJSONLeftSCurveFuzzySet 类的一个静态方法,用于将 JSON 对象转换为 LeftSCurveFuzzySet 对象。

语法

LeftSCurveFuzzySet.fromJSON(jsonObj)

参数

  • jsonObj:类型为 Object。表示要转换的 JSON 对象。

返回值

返回一个 LeftSCurveFuzzySet 对象。

使用示例

// 创建一个 JSON 对象
var jsonObj = {
  "name": "set1",
  "left": 2,
  "right": 7
};

// 使用 fromJSON 方法创建一个 LeftSCurveFuzzySet 对象
var set1 = LeftSCurveFuzzySet.fromJSON(jsonObj);

// 输出 set1 的名称和值
console.log(set1.getName()); // "set1"
console.log(set1.getValue(5)); // 0.5

抛出异常

  • 如果传入的参数不是 Object 类型,则抛出 TypeError。
  • 如果 JSON 对象中缺少 nameleftright 属性,则抛出 Error。