Skip to content

Commit

Permalink
remove ballsocketjoint, add vec2, vec3, vec4 script attribute types
Browse files Browse the repository at this point in the history
  • Loading branch information
Maksims Mihejevs committed Nov 20, 2015
1 parent 9f86ac9 commit 7db8773
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 293 deletions.
3 changes: 0 additions & 3 deletions build/dependencies.txt
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,6 @@
../src/framework/components/physics/collision/collision_system.js
../src/framework/components/physics/collision/collision_component.js
../src/framework/components/physics/collision/collision_data.js
../src/framework/components/physics/joints/ballsocketjoint_system.js
../src/framework/components/physics/joints/ballsocketjoint_component.js
../src/framework/components/physics/joints/ballsocketjoint_data.js
../src/framework/components/particlesystem/particlesystem_system.js
../src/framework/components/particlesystem/particlesystem_component.js
../src/framework/components/particlesystem/particlesystem_data.js
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ pc.extend(pc, function() {
];

this.propertyTypes = {
emitterExtents: 'vector',
wrapBounds: 'vector',
emitterExtents: 'vec3',
wrapBounds: 'vec3',
localVelocityGraph: 'curveset',
localVelocityGraph2: 'curveset',
velocityGraph: 'curveset',
Expand Down Expand Up @@ -103,7 +103,7 @@ pc.extend(pc, function() {
data[prop] = _data[prop];
}

if (types[prop] === 'vector') {
if (types[prop] === 'vec3') {
if (pc.type(data[prop]) === 'array') {
data[prop] = new pc.Vec3(data[prop][0], data[prop][1], data[prop][2]);
}
Expand Down

This file was deleted.

25 changes: 0 additions & 25 deletions src/framework/components/physics/joints/ballsocketjoint_data.js

This file was deleted.

172 changes: 0 additions & 172 deletions src/framework/components/physics/joints/ballsocketjoint_system.js

This file was deleted.

18 changes: 13 additions & 5 deletions src/framework/components/script/script_system.js
Original file line number Diff line number Diff line change
Expand Up @@ -559,14 +559,22 @@ pc.extend(pc, function () {
new pc.Color(attribute.value[0], attribute.value[1], attribute.value[2]) :
new pc.Color(attribute.value[0], attribute.value[1], attribute.value[2], attribute.value[3]);
}
} else if (attribute.type === 'vector') {
if (pc.type(attribute.value) === 'array') {
} else if (attribute.type === 'vec2') {
if (pc.type(attribute.value) === 'array')
attribute.value = new pc.Vec2(attribute.value[0], attribute.value[1]);

} else if (attribute.type === 'vec3' || attribute.type === 'vector') {
if (pc.type(attribute.value) === 'array')
attribute.value = new pc.Vec3(attribute.value[0], attribute.value[1], attribute.value[2]);
}

} else if (attribute.type === 'vec4') {
if (pc.type(attribute.value) === 'array')
attribute.value = new pc.Vec4(attribute.value[0], attribute.value[1], attribute.value[2], attribute.value[3]);

} else if (attribute.type === 'entity') {
if (attribute.value !== null && typeof attribute.value === 'string') {
if (attribute.value !== null && typeof attribute.value === 'string')
attribute.value = this.app.root.findByGuid(attribute.value);
}

} else if (attribute.type === 'curve' || attribute.type === 'colorcurve') {
var curveType = attribute.value.keys[0] instanceof Array ? pc.CurveSet : pc.Curve;
attribute.value = new curveType(attribute.value.keys);
Expand Down
1 change: 0 additions & 1 deletion src/framework/framework_application.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ pc.extend(pc, function () {

var rigidbodysys = new pc.RigidBodyComponentSystem(this);
var collisionsys = new pc.CollisionComponentSystem(this);
var ballsocketjointsys = new pc.BallSocketJointComponentSystem(this);
var animationsys = new pc.AnimationComponentSystem(this);
var modelsys = new pc.ModelComponentSystem(this);
var camerasys = new pc.CameraComponentSystem(this);
Expand Down

0 comments on commit 7db8773

Please sign in to comment.