06-17-2010, 03:08 AM,
|
|
NaN
Posting Freak
|
Posts: 2,024
Threads: 120
Joined: Jan 2010
|
|
Nice job zimluura!
Some suggestions:
Code: [mirror_r]
mesh=mirror_r.joe
texture=mirror.png
position=0.667, 0.401, 0.026
orientation=x, y, z, w
layer=car_noblend ;normal_noblend, twodim, lights_emissive, lights_omni, ....
mass=1.0
shape=capsule ;sphere, capsule, multisphere, box, staticmesh, ...
Not sure about the shape(collision shape). Maybe it should be determined internally(because of speed reasons). Car has a multisphere shape at the moment. Track objects are a single static mesh.
I think we should figure out an object description file format, to be usable with track objects too.
[edit]
Car body and driver should go into accessories.txt too. But then it needs another name.
|
|
06-17-2010, 10:40 AM,
|
|
NaN
Posting Freak
|
Posts: 2,024
Threads: 120
Joined: Jan 2010
|
|
OK. Joe can you elaborate on the light volumes(if I got it right)?
Code: // create brake light point light sources
// this is experimental at the moment and uses fixed
// coordinates to place the brake lights
for (int i = 0; i < 2; i++)
{
lights.push_back(LIGHT());
SCENENODE & bodynoderef = topnode.GetNode(bodynode);
lights.back().node = bodynoderef.AddNode();
SCENENODE & node = bodynoderef.GetNode(lights.back().node);
VERTEXARRAY & varray = lights.back().varray;
MODEL & model = lights.back().model;
varray.SetToUnitCube();
varray.Scale(2.0,2.0,2.0);
//varray.SetToBillboard(-1,-1,1,1);
node.GetTransform().SetTranslation(MATHVECTOR <float,3>(-2.16,-0.45*(i*2-1),-0.18));
model.BuildFromVertexArray(varray, error_output);
keyed_container <DRAWABLE> & dlist = GetDrawlist(node, OMNI);
lights.back().draw = dlist.insert(DRAWABLE());
DRAWABLE & draw = dlist.get(lights.back().draw);
draw.SetColor(0.8,0.1,0.1);
draw.AddDrawList(model.GetListID());
//draw.SetVertArray(&model.GetVertexArray());
draw.SetCull(true, true);
//draw.SetCull(false, false);
draw.SetDrawEnable(false);
}
|
|
06-18-2010, 07:11 AM,
|
|
NaN
Posting Freak
|
Posts: 2,024
Threads: 120
Joined: Jan 2010
|
|
I'd like to use it for headlights too. Have been thinking about the best way to expose it to the user.
Code: [light-0]
position
color
shape/radius
orientation/direction
|
|
06-19-2010, 07:39 PM,
|
|
NaN
Posting Freak
|
Posts: 2,024
Threads: 120
Joined: Jan 2010
|
|
Just fooling around ...
Use dedicated loaders for each [object]. Support simple inheritance [base.derived]. Maybe we should switch to a scripting language, lol.
Code: ; graphics
[model]
name = oem_wheel
mesh = oem_wheel.joe
texture-0 = oem_wheel.png
texture-1 = oem_wheel_misc1.png ;optional, material texture
texture-2 = oem_wheel_misc2.png ;optional, normal texture
position = 0,0,0 ;optional, relative to parent
orientation = 0,0,0 ;optional, euler angles in degrees
scale = 1,1,1 ;optional, use negative numbers to mirror objects
mass = 0.0 ;optional, 0.0 => static object
color = 1,1,1,1 ;if alpha 1 and diffuse texture with alpha do vertex color blend
[model.brake]
name = brake_front
texture-0 = rotor_worn.png
radius = 0.15
width = 0.05
position = -0.05, 0, 0
[model.wheel]
name = wheel_front
size = 205/50r17
texture-0 = touring.png
model = oem_wheel, brake_front
[light]
name = brake_left
position = 0.5, -1.5, 0.3
color = 1, 0, 0
radius = 8
; car dynamics
[tire]
name = tire_front
size = 205/50r17
type = touring
[brake]
name = brake_front
friction = 0.9
max-pressure = 3.0e6
bias = 0.6
radius = 0.1397
area = 0.01
[wheel]
name = front_right
position = -0.73, 1.28, -0.48
scale = -1, 1, 1
tire = tire_front
brake = brake_front
model = wheel_front
|
|
|