Hi
Thought we could do with somewhere to put our objects that are made to work with Dark Physics.
seen a chair,table and window.
if you can do it as a function, so its just cut and paste and call the function, ta-da you have that object.
make a window
function call
create_window(x,y,z,startobjnumber)
add 24 to startobjnumber for next object.
starting varablies
global lw# = 1.0
global lt# = 10.0
global cw# = 5.0
global sw# = 11.0
global cxp# = -10.0
global cyp# = 10.0
global wh# = 35.0
the materails
`make a physics material for the objects
phy make material 1, "wooden"
phy set material static friction 1, 25.0
phy set material restitution 1, 0.0
phy set material dynamic friction 1, 1.0
phy build material 1
glass=2
phy make material glass,"glass"
phy set material static friction glass,0.1
phy set material dynamic friction glass,0.1
phy set material restitution glass,0.25
phy build material glass
the function
function create_window(cxp#,cyp#,wh#,first_obj)
rem lw# = 1.0 lt# = 10.0 cw# = 5.0 sw# = 11.0 cxp# = -10.0 cyp# = 10.0 wh# = 35.0
rem w h d
rem sill for window
make object box first_obj,(sw#*3)-2,lw#*2+0.2,lw#*2
position object first_obj,cxp#+2,(wh#+lt#)-cw#-1.1,cyp#
color object first_obj,RGB(159,253,218)
phy make rigid body static box first_obj,2
framecol=RGB(128,0,0)
glasscol=rgb(10,10,50)
rem pane 1
make object box first_obj+1,sw#-2,lw#*9,lw#
position object first_obj+1,cxp#,(wh#+lt#)+0.5,cyp#
color object first_obj+1,glasscol
ghost object on first_obj+1,2
phy make rigid body dynamic box first_obj+1,2
rem left bottom frame
make object box first_obj+2,sw#-1,lw#,lw#
position object first_obj+2,cxp#-0.5,(wh#+lt#)-4.5.,cyp#
color object first_obj+2,framecol
phy make rigid body dynamic box first_obj+2,1
rem left side frame 1
make object box first_obj+3,lw#,sw#-1,lw#
position object first_obj+3,cxp#-5.0,wh#+lt#+1.0,cyp#
color object first_obj+3,framecol
phy make rigid body dynamic box first_obj+3,1
rem left top frame 1
make object box first_obj+4,sw#-1,lw#,lw#
position object first_obj+4,cxp#+0.5,wh#+lt#+5.5,cyp#
color object first_obj+4,framecol
phy make rigid body dynamic box first_obj+4,1
rem right side frame 1
make object box first_obj+5,lw#,sw#-1,lw#
position object first_obj+5,cxp#+5.0,wh#+lt#,cyp#
color object first_obj+5,framecol
phy make rigid body dynamic box first_obj+5,1
rem next pane 2
make object box first_obj+6,sw#-2,lw#*9,lw#
position object first_obj+6,cxp#,wh#+lt#+sw#-0.5,cyp#
color object first_obj+6,glasscol
ghost object on first_obj+6,2
phy make rigid body dynamic box first_obj+6,2
rem left side frame 2
make object box first_obj+7,lw#,sw#-1,lw#
position object first_obj+7,cxp#-5.0,wh#+lt#+sw#,cyp#
color object first_obj+7,framecol
phy make rigid body dynamic box first_obj+7,1
rem top frame 2
make object box first_obj+8,sw#-1,lw#,lw#
position object first_obj+8,cxp#+0.5,wh#+lt#+sw#+4.6,cyp#
color object first_obj+8,framecol
phy make rigid body dynamic box first_obj+8,1
rem right frame 2
make object box first_obj+9,lw#,sw#-2,lw#
position object first_obj+9,cxp#+5.0,wh#+lt#+sw#-0.5,cyp#
color object first_obj+9,framecol
phy make rigid body dynamic box first_obj+9,1
rem next pane 3
make object box first_obj+10,sw#-2,lw#*9,lw#
position object first_obj+10,cxp#,wh#+lt#+(sw#*2)-0.5,cyp#
color object first_obj+10,glasscol
ghost object on first_obj+10,2
phy make rigid body dynamic box first_obj+10,2
rem left side frame 3
make object box first_obj+11,lw#,sw#-1,lw#
position object first_obj+11,cxp#-5.0,wh#+lt#+(sw#*2),cyp#
color object first_obj+11,framecol
phy make rigid body dynamic box first_obj+11,1
rem top frame 3
make object box first_obj+12,sw#-1,lw#,lw#
position object first_obj+12,cxp#+0.5,wh#+lt#+(sw#*2)+4.6,cyp#
color object first_obj+12,framecol
phy make rigid body dynamic box first_obj+12,1
rem right frame 3
make object box first_obj+13,lw#,sw#-2,lw#
position object first_obj+13,cxp#+5.0,wh#+lt#+(sw#*2)-0.5,cyp#
color object first_obj+13,framecol
phy make rigid body dynamic box first_obj+13,1
remstart
rem pane bottom right 4
make object box first_obj+14,sw#-2,lw#*9,lw#
position object first_obj+14,cxp#+sw#-0.9,(wh#+lt#)+0.5,cyp#
color object first_obj+14,glasscol
ghost object on first_obj+14,2
phy make rigid body dynamic box first_obj+14,2
rem right bottom frame 4
make object box first_obj+15,sw#-1.0,lw#,lw#
position object first_obj+15,cxp#+sw#-0.9,(wh#+lt#)-4.5.,cyp#
color object first_obj+15,framecol
phy make rigid body dynamic box first_obj+15,1
rem right side frame 4
make object box first_obj+16,lw#,sw#-1,lw#
position object first_obj+16,cxp#+sw#+5.1,wh#+lt#,cyp#
color object first_obj+16,framecol
phy make rigid body dynamic box first_obj+16,1
rem right top frame 4
make object box first_obj+17,sw#-1.5,lw#,lw#
position object first_obj+17,cxp#+sw#-0.9,wh#+lt#+5.5,cyp#
color object first_obj+17,framecol
phy make rigid body dynamic box first_obj+17,1
remend
rem join them up
rem bottom left
phy make fixed joint first_obj,first_obj,first_obj+2
phy make fixed joint first_obj+1,first_obj+2,first_obj+1
phy make fixed joint first_obj+2,first_obj+3,first_obj+1
phy make fixed joint first_obj+3,first_obj+4,first_obj+1
phy make fixed joint first_obj+4,first_obj+5,first_obj+1
rem middle left
phy make fixed joint first_obj+5,first_obj+4,first_obj+6
phy make fixed joint first_obj+6,first_obj+7,first_obj+6
phy make fixed joint first_obj+7,first_obj+8,first_obj+6
phy make fixed joint first_obj+8,first_obj+9,first_obj+6
rem top left
phy make fixed joint first_obj+9,first_obj+11,first_obj+10
phy make fixed joint first_obj+10,first_obj+12,first_obj+10
phy make fixed joint first_obj+11,first_obj+13,first_obj+10
`phy make fixed joint first_obj+12,first_obj+13,first_obj+10
for jj=first_obj to first_obj+13
phy set joint break limits jj, 7000, 7000
next jj
endfunction
Dark Physics makes any hot drink go cold.