Posts: 9
Threads: 4
Joined: Jun 26, 2010
Hi Drunken_F00l, can you post fix angles process on "models/props_wasteland/wheel02a.mdl" in e_wheel source code?
i want fix that angles, but i dont know how to do. :?:
Posts: 5,877
Threads: 182
Joined: Dec 11, 2004
Posts: 9
Threads: 4
Joined: Jun 26, 2010
how can i fix it with sourcemod :?
matrix function didn't included in sourcemod :roll:
here is my code:
Code:
if(Build_RegisterEntityOwner(Client, wheelIndex)) {
new Float:hitPos[3];
new Float:hitNormal[3];
TR_GetEndPosition(hitPos, trace);
TR_GetPlaneNormal(trace, hitNormal);
GetArrayString(g_hWheelModelPathArray, IndexInArray, szModelPath, sizeof(szModelPath));
if(!IsModelPrecached(szModelPath))
PrecacheModel(szModelPath);
DispatchKeyValue(wheelIndex, "model", szModelPath);
DispatchKeyValue(wheelIndex, "spawnflags", "256");
DispatchKeyValueFloat(wheelIndex, "physdamagescale", 0.0);
DispatchKeyValueFloat(wheelIndex, "ExplodeDamage", 0.0);
DispatchKeyValueFloat(wheelIndex, "ExplodeRadius", 0.0);
DispatchSpawn(wheelIndex);
ActivateEntity(wheelIndex);
new Float:surfaceAng[3];
GetVectorAngles(hitNormal, surfaceAng);
new Float:wheelCenter[3]; // Should be calculating the width of the model for this.
new Float:vecToAdd[3];
vecToAdd[0] = hitNormal[0];
vecToAdd[1] = hitNormal[1];
vecToAdd[2] = hitNormal[2];
switch(StringToInt(szWheelName)) {
case 1:
ScaleVector(vecToAdd, 5.0);
case 2:
ScaleVector(vecToAdd, 10.0);
case 3:
ScaleVector(vecToAdd, 7.5);
case 4:
ScaleVector(vecToAdd, 12.5);
case 5:
ScaleVector(vecToAdd, 11.0);
case 6:
ScaleVector(vecToAdd, 40.0);
case 7:
ScaleVector(vecToAdd, 40.0);
}
AddVectors(hitPos, vecToAdd, wheelCenter);
TeleportEntity(wheelIndex, wheelCenter, surfaceAng, NULL_VECTOR);
Phys_CreateHingeConstraint(entIndex, wheelIndex, INVALID_HANDLE, hitPos, hitNormal);
Build_PrintToChat(Client, "Added wheel to target");
}
Posts: 5,877
Threads: 182
Joined: Dec 11, 2004
Oh, I don't know if sourcemod has matrix math functions. You'll have to check with them. If not, you could write your own by converting the ones you need from the SDK.