Closed Luomu closed 11 years ago
I am going to completely ignore space stations until newmodel is otherwise working with the game.
Idea: separate the docking sequence specific lua from LMR and use that with new models as well, in SpaceStation.
I don't feel like hacking in specific collision surfaces (LMR uses separate collision flags for landing spots 1-4). Could define them as points instead.
Suggestions:
I have separated station definitions in Luomu/separate-station-defs, a data/stations/some_station.lua looks like this:
define_surface_station {
model = 'ground_station_4',
num_docking_ports = 4,
dock_anim_stage_duration = { DOCKING_TIMEOUT_SECONDS, 4.0},
undock_anim_stage_duration = { 0 },
ship_dock_anim = function(port, stage, t, from, ship_aabb)
local port_pos = { v(-150,50,0), v(150,50,0), v(0,50,-150), v(0,50,150) }
if stage == 2 then
return { vlerp(t, from, port_pos[port] - v(0,ship_aabb.min.y,0)), v(1,0,0), v(0,1,0) }
end
end,
ship_approach_waypoints = function(port, stage)
local port_pos = { v(-150,50,0), v(150,50,0), v(0,50,-150), v(0,50,150) }
if stage == 1 then
return { v(port_pos[port].x, port_pos[port].y+1000, port_pos[port].z), v(1,0,0), v(0,1,0) }
elseif stage == 2 then
return { v(port_pos[port].x, port_pos[port].y, port_pos[port].z), v(1,0,0), v(0,1,0) }
end
end
}
Now it's almost possible to create a (unanimated) station in new-model.
Not going to create a PR yet since the game does not currently need this. @robn you might be interested to know, @fluffyfreak too since you are doing things with stations.
Yeah probably not worth doing yet, but definitely interesting. Nice work.
I might pull this into the work that I'm playing with on issue 16.
I've also just committed some rather random work in progress stuff on my FluffyFreak/station branch BUT BE WARNED it's really rough and I'm mostly just hacking on it in the 15 to 60 mins I get on an evening so won't be what actually gets turned into a PR one day, but will be where if figure out what will go into a branch that does :)
Added support for collision surfaces (bays 1-4), so it's now possible to create an unanimated station or a landing pad.
Waypoints etc.
Perhaps: export special animation file Also consider: temporarily attach ship geometry to an animated node when docking surface has been reached (attaching things to each other should have been done at Body level but meh)