cleanup before reworking the scripting engine layout:
This commit is contained in:
parent
4ff557d446
commit
803af8c37a
6 changed files with 130 additions and 108 deletions
|
@ -3,68 +3,6 @@ pw.script:initialize()
|
|||
|
||||
print("hello pixwerx!")
|
||||
|
||||
local v1 = pw.vector3.new(3,2,1)
|
||||
v1:set(0,1,2)
|
||||
|
||||
print("v1 ",v1.x,v1.y,v1.z)
|
||||
|
||||
|
||||
---- objects need to be cloned
|
||||
----local v2 = v:clone()
|
||||
--local v2 = v
|
||||
|
||||
---- manipulate stuff
|
||||
--v.x = 0.2
|
||||
--v.y = pw.pi
|
||||
|
||||
|
||||
--print("v : ", v:v())
|
||||
--print("v2: ", v2:v())
|
||||
|
||||
local q = pw.quaternion.new()
|
||||
print("q",q.x,q.y,q.z,q.w)
|
||||
|
||||
qi = q.inverse
|
||||
print("q.inverse",qi.x,qi.y,qi.z,qi.w)
|
||||
|
||||
local q2 = pw.quaternion.new(0,0,0,1)
|
||||
|
||||
qm = pw.quaternion.lerp(q,qi,0.5)
|
||||
print("q.m",qm.x,qm.y,qm.z,qm.w)
|
||||
|
||||
-- axis angle test
|
||||
local aa = pw.axisangle.new(v1,0.707)
|
||||
|
||||
print("aa.axis",aa.axis.x,aa.axis.y,aa.axis.z)
|
||||
print("aa.angle",aa.angle)
|
||||
|
||||
local n_1 = pw.node.create()
|
||||
n_1.name = "root"
|
||||
|
||||
print("node 1: ", n_1.name)
|
||||
|
||||
--print(pw.node.create())
|
||||
|
||||
n_1:add_child(pw.node.create()).name = "one"
|
||||
n_1:add_child(pw.node.create()).name = "two"
|
||||
n_1:add_child(pw.node.create()).name = "three"
|
||||
n_1:add_child(pw.node.create()).name = "four"
|
||||
n_1:add_child(pw.node.create()).name = "five"
|
||||
|
||||
--n_1:add_child(n_2:shared())
|
||||
|
||||
print("node 1 - child count ",n_1.child_count)
|
||||
|
||||
-- stuff
|
||||
for i = 1,n_1.child_count do
|
||||
print(i,n_1.children[i],n_1.children[i].name)
|
||||
end
|
||||
|
||||
--print(n_1:shared())
|
||||
--print(pw.my_func())
|
||||
|
||||
--n_1:add_child()
|
||||
|
||||
local w = pw.window.new()
|
||||
w.visible = false
|
||||
|
||||
|
|
28
src/scripts/tests/test_core.lua
Normal file
28
src/scripts/tests/test_core.lua
Normal file
|
@ -0,0 +1,28 @@
|
|||
-- loading our libraries
|
||||
pw.script:initialize()
|
||||
|
||||
print("hello pixwerx!")
|
||||
|
||||
local v1 = pw.vector3.new(3,2,1)
|
||||
|
||||
print("v1 ",v1.x,v1.y,v1.z)
|
||||
|
||||
local q = pw.quaternion.new()
|
||||
q = pw.quaternion.identity
|
||||
print("q",q.x,q.y,q.z,q.w)
|
||||
|
||||
qi = q.inverse
|
||||
print("q.inverse",qi.x,qi.y,qi.z,qi.w)
|
||||
|
||||
local q2 = pw.quaternion.new(0,0,0,1)
|
||||
|
||||
-- bug!
|
||||
--qm = pw.quaternion.lerp(q,qi,0.5)
|
||||
--print("q.m",qm.x,qm.y,qm.z,qm.w)
|
||||
|
||||
-- axis angle test
|
||||
local aa = pw.axisangle.new(v1,0.707)
|
||||
|
||||
print("aa.axis",aa.axis.x,aa.axis.y,aa.axis.z)
|
||||
print("aa.angle",aa.angle)
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue