Vehicle Model Not Rendering
by Rob Sandbach · in Torque Game Engine · 08/01/2006 (2:23 am) · 3 replies
Hi there,
Ive come to adding a model to stock tge 1.4, and have run into some issues at a basic level. I have basically copied car.cs, and modified the vehicle into a hover vehicle using an example datablock. When I go into game the player behaves exactly as a hoverVehicle should, but no model or collision mesh renders. When I drop the shape as a static it it render pefectly with collision mesh etc. I'm at a loss at determining exactly what is wrong, the scripts or the model, and why the model will work as a static but not as an actual vehicle.
I have included all the info I have, and I would appreciate any help people can offer.
Schematics of the model

Dump of exporter
www.urban-games.net/junk/dump.dmp
Current "hover.cs":
Ive come to adding a model to stock tge 1.4, and have run into some issues at a basic level. I have basically copied car.cs, and modified the vehicle into a hover vehicle using an example datablock. When I go into game the player behaves exactly as a hoverVehicle should, but no model or collision mesh renders. When I drop the shape as a static it it render pefectly with collision mesh etc. I'm at a loss at determining exactly what is wrong, the scripts or the model, and why the model will work as a static but not as an actual vehicle.
I have included all the info I have, and I would appreciate any help people can offer.
Schematics of the model
Dump of exporter
www.urban-games.net/junk/dump.dmp
Current "hover.cs":
//**************************************************************
// VEHICLE CHARACTERISTICS
//**************************************************************
datablock HoverVehicleData(HoverRacer)
{
spawnOffset = "0 0 1";
floatingGravMag = 50.5;
category = "Vehicles";
shapeFile = "~/data/shapes/racer/racer.dts";
computeCRC = false;
//debrisShapeName = "~/data/shapes/racer/racer.dts";
//debris = ShapeDebris;
//renderWhenDestroyed = false;
drag = 0.0;
density = 0.3;
cameraMaxDist = 15.0;
cameraOffset = 5.7;
cameraLag = 5.5;
explosion = AssaultTankExplosion;
explosionDamage = 0.5;
explosionRadius = 5.0;
lightOnly = 1;
maxDamage = 120;
destroyedLevel = 120;
isShielded = true;
rechargeRate = 0.7;
energyPerDamagePoint = 75;
maxEnergy = 150;
minJetEnergy = 15;
jetEnergyDrain = 1.3;
// Rigid Body
mass = 5;
bodyFriction = 0;
bodyRestitution = 0.5;
softImpactSpeed = 20; // Play SoftImpact Sound
hardImpactSpeed = 28; // Play HardImpact Sound
// Ground Impact Damage (uses DamageType::Ground)
minImpactSpeed = 29;
speedDamageScale = 0.010;
// Object Impact Damage (uses DamageType::Impact)
collDamageThresholdVel = 23;
collDamageMultiplier = 0.030;
dragForce = 1.9;
// dragForce = 25 / 45.0;
vertFactor = 0.5;
floatingThrustFactor = 0.35;
mainThrustForce = 100;
reverseThrustForce = 70;
strafeThrustForce = 70;
turboFactor = 1.5;
brakingForce = 30;
brakingActivationSpeed = 30;
stabLenMin = 6.50;
stabLenMax = 7.25;
stabSpringConstant = 20;
stabDampingConstant = 20;
gyroDrag = 36; // 16
// gyroForce = 50
normalForce = 10;
restorativeForce = 100;
steeringForce = 90;
rollForce = 7;
pitchForce = 10;
};
function createhoverracer()
{
$hoverracer = new HoverVehicle() {
dataBlock = HoverRacer;
};
return(%obj);
}
function HoverVehicleData::create(%block)
{
%obj = new HoverVehicle() {
dataBlock = %block;
};
return(%obj);
}
//-----------------------------------------------------------------------------
function HoverVehicleData::onAdd(%this,%obj)
{
}
function WheeledVehicleData::onCollision(%this,%obj,%col,%vec,%speed)
{
// Collision with other objects, including items
}
#2
08/08/2006 (9:05 am)
Exactly what Anthony said. Your mesh is set to a detail level of negative 1. The number in the mesh and detail marker isn't arbitrary, its the pixel size that that level of detail will show up at. If you have a detail level of, for example, 64, as soon as the object in question is 64 pixels big, it will use that level of detail. A shape won't ever be -1 pixels big, so it won't ever be rendered. Thats precisely why the collision shapes use negative detail numbers.
#3
08/10/2006 (10:00 am)
Thank you very much for your help. problem solved.
Associate Anthony Rosenbaum
[b]racer1[\b] not racer-1 that is negative, classic typo