Constructor
new Relationship(param)
The relationship between objects.
Parameters:
Name | Type | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
param |
Object |
Properties
|
- Source:
Members
name :String
Get/Set the relationship name.
Type:
- String
- Source:
Example
let source = new THING.Object3D()();
let target = new THING.Object3D()();
let rel = new THING.Relationship({
type: 'control',
name: 'myRelationship',
source: source,
target: target
});
// @expect(rel.name == 'myRelationship')
queryDirection :RelationshipDirection
Get/Set the relationship default query direction.
Type:
- Source:
Example
let source = new THING.Object3D()();
let target = new THING.Object3D()();
let rel = new THING.Relationship({
type: 'control',
name: 'myRelationship',
source: source,
target: target
});
// @expect(rel.queryDirection == THING.RelationshipDirection.OUT)
source :THING.BaseObject|Array.<THING.BaseObject>|THING.Selector
Get/Set the relationship source object.
Type:
- THING.BaseObject | Array.<THING.BaseObject> | THING.Selector
- Source:
Example
let source = new THING.Object3D()();
let target = new THING.Object3D()();
let rel = new THING.Relationship({
type: 'control',
name: 'myRelationship',
source: source,
target: target
});
// @expect(rel.source == source)
target :THING.BaseObject|Array.<THING.BaseObject>|THING.Selector
Get/Set the relationship target.
Type:
- THING.BaseObject | Array.<THING.BaseObject> | THING.Selector
- Source:
Example
let source = new THING.Object3D()();
let target = new THING.Object3D()();
let rel = new THING.Relationship({
type: 'control',
name: 'myRelationship',
source: source,
target: target
});
// @expect(rel.target == target)
type :String
Get/Set the relationship type.
Type:
- String
- Source:
Example
let source = new THING.Object3D()();
let target = new THING.Object3D()();
let rel = new THING.Relationship({
type: 'control',
source: source,
target: target
});
// @expect(rel.type == 'control')
uuid :String
Get/Set uuid.
Type:
- String
- Source:
Example
relationship.uuid = THING.Math.generateUUID();
console.log(object.uuid);
Methods
destroy()
destroy relationship
- Source:
Example
let source = new THING.Object3D()();
let target = new THING.Object3D()();
let rel = new THING.Relationship({
type: 'control',
source: source,
target: target
});
rel.destroy()
// @expect(source.relationships.length == 0)