Expose node target
This commit is contained in:
parent
cf78136dbe
commit
ed4234f6b4
|
@ -22,10 +22,7 @@ class AppendTransformNode extends LogicNode {
|
||||||
|
|
||||||
#if arm_physics
|
#if arm_physics
|
||||||
var rigidBody = object.getTrait(RigidBody);
|
var rigidBody = object.getTrait(RigidBody);
|
||||||
if (rigidBody != null) {
|
if (rigidBody != null) rigidBody.syncTransform();
|
||||||
rigidBody.syncTransform();
|
|
||||||
rigidBody.activate();
|
|
||||||
}
|
|
||||||
#end
|
#end
|
||||||
|
|
||||||
super.run();
|
super.run();
|
||||||
|
|
|
@ -29,10 +29,7 @@ class RotateObjectNode extends LogicNode {
|
||||||
|
|
||||||
#if arm_physics
|
#if arm_physics
|
||||||
var rigidBody = object.getTrait(RigidBody);
|
var rigidBody = object.getTrait(RigidBody);
|
||||||
if (rigidBody != null) {
|
if (rigidBody != null) rigidBody.syncTransform();
|
||||||
rigidBody.syncTransform();
|
|
||||||
rigidBody.activate();
|
|
||||||
}
|
|
||||||
#end
|
#end
|
||||||
|
|
||||||
super.run();
|
super.run();
|
||||||
|
|
|
@ -24,10 +24,7 @@ class ScaleObjectNode extends LogicNode {
|
||||||
|
|
||||||
#if arm_physics
|
#if arm_physics
|
||||||
var rigidBody = object.getTrait(RigidBody);
|
var rigidBody = object.getTrait(RigidBody);
|
||||||
if (rigidBody != null) {
|
if (rigidBody != null) rigidBody.syncTransform();
|
||||||
rigidBody.syncTransform();
|
|
||||||
rigidBody.activate();
|
|
||||||
}
|
|
||||||
#end
|
#end
|
||||||
|
|
||||||
super.run();
|
super.run();
|
||||||
|
|
|
@ -23,10 +23,7 @@ class SetLocationNode extends LogicNode {
|
||||||
|
|
||||||
#if arm_physics
|
#if arm_physics
|
||||||
var rigidBody = object.getTrait(RigidBody);
|
var rigidBody = object.getTrait(RigidBody);
|
||||||
if (rigidBody != null) {
|
if (rigidBody != null) rigidBody.syncTransform();
|
||||||
rigidBody.syncTransform();
|
|
||||||
rigidBody.activate();
|
|
||||||
}
|
|
||||||
#end
|
#end
|
||||||
|
|
||||||
super.run();
|
super.run();
|
||||||
|
|
|
@ -23,10 +23,7 @@ class SetRotationNode extends LogicNode {
|
||||||
|
|
||||||
#if arm_physics
|
#if arm_physics
|
||||||
var rigidBody = object.getTrait(RigidBody);
|
var rigidBody = object.getTrait(RigidBody);
|
||||||
if (rigidBody != null) {
|
if (rigidBody != null) rigidBody.syncTransform();
|
||||||
rigidBody.syncTransform();
|
|
||||||
rigidBody.activate();
|
|
||||||
}
|
|
||||||
#end
|
#end
|
||||||
|
|
||||||
super.run();
|
super.run();
|
||||||
|
|
|
@ -23,10 +23,7 @@ class SetScaleNode extends LogicNode {
|
||||||
|
|
||||||
#if arm_physics
|
#if arm_physics
|
||||||
var rigidBody = object.getTrait(RigidBody);
|
var rigidBody = object.getTrait(RigidBody);
|
||||||
if (rigidBody != null) {
|
if (rigidBody != null) rigidBody.syncTransform();
|
||||||
rigidBody.syncTransform();
|
|
||||||
rigidBody.activate();
|
|
||||||
}
|
|
||||||
#end
|
#end
|
||||||
|
|
||||||
super.run();
|
super.run();
|
||||||
|
|
|
@ -22,10 +22,7 @@ class SetTransformNode extends LogicNode {
|
||||||
|
|
||||||
#if arm_physics
|
#if arm_physics
|
||||||
var rigidBody = object.getTrait(RigidBody);
|
var rigidBody = object.getTrait(RigidBody);
|
||||||
if (rigidBody != null) {
|
if (rigidBody != null) rigidBody.syncTransform();
|
||||||
rigidBody.syncTransform();
|
|
||||||
rigidBody.activate();
|
|
||||||
}
|
|
||||||
#end
|
#end
|
||||||
|
|
||||||
super.run();
|
super.run();
|
||||||
|
|
|
@ -24,10 +24,7 @@ class TranslateObjectNode extends LogicNode {
|
||||||
|
|
||||||
#if arm_physics
|
#if arm_physics
|
||||||
var rigidBody = object.getTrait(RigidBody);
|
var rigidBody = object.getTrait(RigidBody);
|
||||||
if (rigidBody != null) {
|
if (rigidBody != null) rigidBody.syncTransform();
|
||||||
rigidBody.syncTransform();
|
|
||||||
rigidBody.activate();
|
|
||||||
}
|
|
||||||
#end
|
#end
|
||||||
|
|
||||||
super.run();
|
super.run();
|
||||||
|
|
|
@ -258,6 +258,7 @@ class RigidBody extends Trait {
|
||||||
// _motionState.getWorldTransform(trans);
|
// _motionState.getWorldTransform(trans);
|
||||||
// trans.setOrigin(BtVector3.create(transform.loc.x, transform.loc.y, transform.loc.z));
|
// trans.setOrigin(BtVector3.create(transform.loc.x, transform.loc.y, transform.loc.z));
|
||||||
// _motionState.setWorldTransform(trans);
|
// _motionState.setWorldTransform(trans);
|
||||||
|
activate();
|
||||||
}
|
}
|
||||||
|
|
||||||
function addPointsToConvexHull(shape:BtConvexHullShapePointer, scale:Vec4, margin:Float) {
|
function addPointsToConvexHull(shape:BtConvexHullShapePointer, scale:Vec4, margin:Float) {
|
||||||
|
|
|
@ -98,7 +98,7 @@ class SpaceArmory extends Trait {
|
||||||
// moveX = moveY = moveZ = false;
|
// moveX = moveY = moveZ = false;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
#if (js && kha_webgl)
|
#if (js && kha_webgl && !kha_node)
|
||||||
time += iron.system.Time.delta;
|
time += iron.system.Time.delta;
|
||||||
if (time > 1.0) {
|
if (time > 1.0) {
|
||||||
time = 0;
|
time = 0;
|
||||||
|
@ -107,7 +107,7 @@ class SpaceArmory extends Trait {
|
||||||
#end
|
#end
|
||||||
}
|
}
|
||||||
|
|
||||||
#if (js && kha_webgl)
|
#if (js && kha_webgl && !kha_node)
|
||||||
static var time = 0.0;
|
static var time = 0.0;
|
||||||
static var lastMtime:Dynamic = null;
|
static var lastMtime:Dynamic = null;
|
||||||
function reloadOnUpdate() {
|
function reloadOnUpdate() {
|
||||||
|
|
|
@ -47,5 +47,7 @@ def target_to_gapi():
|
||||||
return 'arm_gapi_winapp'
|
return 'arm_gapi_winapp'
|
||||||
elif wrd.arm_project_target == 'android-native':
|
elif wrd.arm_project_target == 'android-native':
|
||||||
return 'arm_gapi_android'
|
return 'arm_gapi_android'
|
||||||
|
elif wrd.arm_project_target == 'node':
|
||||||
|
return 'arm_gapi_html5'
|
||||||
else:
|
else:
|
||||||
return 'arm_gapi_' + wrd.arm_project_target
|
return 'arm_gapi_' + wrd.arm_project_target
|
||||||
|
|
|
@ -124,7 +124,8 @@ def init_properties():
|
||||||
('linux', 'Linux', 'linux'),
|
('linux', 'Linux', 'linux'),
|
||||||
('ios', 'iOS', 'ios'),
|
('ios', 'iOS', 'ios'),
|
||||||
('android-native', 'Android', 'android-native'),
|
('android-native', 'Android', 'android-native'),
|
||||||
('krom', 'Krom', 'krom')],
|
('krom', 'Krom', 'krom'),
|
||||||
|
('node', 'Node', 'node')],
|
||||||
name="Target", default='html5', description='Build paltform')
|
name="Target", default='html5', description='Build paltform')
|
||||||
bpy.types.World.arm_project_name = StringProperty(name="Name", description="Exported project name", default="")
|
bpy.types.World.arm_project_name = StringProperty(name="Name", description="Exported project name", default="")
|
||||||
bpy.types.World.arm_project_package = StringProperty(name="Package", description="Package name for scripts", default="arm")
|
bpy.types.World.arm_project_package = StringProperty(name="Package", description="Package name for scripts", default="arm")
|
||||||
|
|
|
@ -73,7 +73,7 @@ project.addSources('Sources');
|
||||||
if export_physics:
|
if export_physics:
|
||||||
assets.add_khafile_def('arm_physics')
|
assets.add_khafile_def('arm_physics')
|
||||||
f.write(add_armory_library(sdk_path + '/lib/', 'haxebullet'))
|
f.write(add_armory_library(sdk_path + '/lib/', 'haxebullet'))
|
||||||
if state.target == 'krom' or state.target == 'html5':
|
if state.target == 'krom' or state.target == 'html5' or state.target == 'node':
|
||||||
ammojs_path = sdk_path + '/lib/haxebullet/js/ammo/ammo.js'
|
ammojs_path = sdk_path + '/lib/haxebullet/js/ammo/ammo.js'
|
||||||
ammojs_path = ammojs_path.replace('\\', '/')
|
ammojs_path = ammojs_path.replace('\\', '/')
|
||||||
f.write(add_assets(ammojs_path))
|
f.write(add_assets(ammojs_path))
|
||||||
|
|
Loading…
Reference in a new issue