Compare commits
7 Commits
265af16061
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7697572fa2 | ||
|
|
5fd44bb600 | ||
|
|
a662f35fcd | ||
|
|
ba2fed871d | ||
|
|
2828355b82 | ||
|
|
5b9fdf1a25 | ||
|
|
969c8e3bd0 |
@@ -32,7 +32,7 @@
|
||||
"go": "88ba51ec-9552-4022-a23e-0fb53b88afec",
|
||||
"component_type": "ModelCollider"
|
||||
},
|
||||
"CounterSteer": 0.1,
|
||||
"CounterSteer": 0,
|
||||
"Engine": {
|
||||
"_type": "component",
|
||||
"component_id": "0bc0d7ab-0688-4447-bb86-271c960a4cd8",
|
||||
@@ -112,7 +112,7 @@
|
||||
"Yaw": false,
|
||||
"Roll": false
|
||||
},
|
||||
"MassCenterOverride": "0,0,0",
|
||||
"MassCenterOverride": "5,0,25",
|
||||
"MassOverride": 0,
|
||||
"MotionEnabled": true,
|
||||
"OnComponentDestroy": null,
|
||||
@@ -121,7 +121,7 @@
|
||||
"OnComponentFixedUpdate": null,
|
||||
"OnComponentStart": null,
|
||||
"OnComponentUpdate": null,
|
||||
"OverrideMassCenter": false,
|
||||
"OverrideMassCenter": true,
|
||||
"RigidbodyFlags": 0,
|
||||
"StartAsleep": false
|
||||
},
|
||||
@@ -171,6 +171,7 @@
|
||||
"CreateBoneObjects": true,
|
||||
"MaterialGroup": null,
|
||||
"MaterialOverride": null,
|
||||
"Materials": null,
|
||||
"Model": "models/laurel_c33_root/laurel_c33_root.vmdl",
|
||||
"Morphs": {},
|
||||
"OnComponentDestroy": null,
|
||||
@@ -206,6 +207,7 @@
|
||||
"__type": "Sandbox.ModelCollider",
|
||||
"__guid": "827d88fc-6ad4-46de-aa77-95f12ff8dd1b",
|
||||
"__enabled": true,
|
||||
"Elasticity": null,
|
||||
"Friction": null,
|
||||
"IsTrigger": false,
|
||||
"Model": "models/laurel_c33_root/laurel_c33_root.vmdl",
|
||||
@@ -219,6 +221,7 @@
|
||||
"OnObjectTriggerExit": null,
|
||||
"OnTriggerEnter": null,
|
||||
"OnTriggerExit": null,
|
||||
"RollingResistance": null,
|
||||
"Static": false,
|
||||
"Surface": null,
|
||||
"SurfaceVelocity": "0,0,0"
|
||||
@@ -4978,10 +4981,11 @@
|
||||
"__type": "VeloX.VeloXWheel",
|
||||
"__guid": "64e23ffa-c2d8-4d1b-97e2-2e6ec074e350",
|
||||
"__enabled": true,
|
||||
"Ackermann": 0.2,
|
||||
"AutoPhysics": true,
|
||||
"BrakePowerMax": 3000,
|
||||
"CamberAngle": -5,
|
||||
"CasterAngle": 0,
|
||||
"CamberAngle": 0,
|
||||
"CasterAngle": 6,
|
||||
"IsFront": true,
|
||||
"Mass": 30,
|
||||
"OnComponentDestroy": null,
|
||||
@@ -4997,8 +5001,8 @@
|
||||
"SpringStrength": 2800,
|
||||
"SteerMultiplier": 1,
|
||||
"SuspensionLength": 5,
|
||||
"TirePreset": "frictions/default.tire",
|
||||
"ToeAngle": -0.5,
|
||||
"WheelFriction": "frictions/high-performance road tire.whfric",
|
||||
"Width": 9
|
||||
}
|
||||
],
|
||||
@@ -5029,6 +5033,7 @@
|
||||
"CreateBoneObjects": false,
|
||||
"MaterialGroup": null,
|
||||
"MaterialOverride": null,
|
||||
"Materials": null,
|
||||
"Model": "models/laurel_c33_root/wheel.vmdl",
|
||||
"Morphs": {},
|
||||
"OnComponentDestroy": null,
|
||||
@@ -5084,10 +5089,11 @@
|
||||
"__type": "VeloX.VeloXWheel",
|
||||
"__guid": "1863c712-5c7c-427b-b734-87b732d65502",
|
||||
"__enabled": true,
|
||||
"Ackermann": -0.2,
|
||||
"AutoPhysics": true,
|
||||
"BrakePowerMax": 3000,
|
||||
"CamberAngle": 5,
|
||||
"CasterAngle": 0,
|
||||
"CamberAngle": 0,
|
||||
"CasterAngle": -6,
|
||||
"IsFront": true,
|
||||
"Mass": 30,
|
||||
"OnComponentDestroy": null,
|
||||
@@ -5103,8 +5109,8 @@
|
||||
"SpringStrength": 2800,
|
||||
"SteerMultiplier": 1,
|
||||
"SuspensionLength": 5,
|
||||
"TirePreset": "frictions/default.tire",
|
||||
"ToeAngle": 0.5,
|
||||
"WheelFriction": "frictions/high-performance road tire.whfric",
|
||||
"Width": 9
|
||||
}
|
||||
],
|
||||
@@ -5135,6 +5141,7 @@
|
||||
"CreateBoneObjects": false,
|
||||
"MaterialGroup": null,
|
||||
"MaterialOverride": null,
|
||||
"Materials": null,
|
||||
"Model": "models/laurel_c33_root/wheel.vmdl",
|
||||
"Morphs": {},
|
||||
"OnComponentDestroy": null,
|
||||
@@ -5190,9 +5197,10 @@
|
||||
"__type": "VeloX.VeloXWheel",
|
||||
"__guid": "32fbede7-4c34-4f7d-8ec3-594774e693dc",
|
||||
"__enabled": true,
|
||||
"Ackermann": 0,
|
||||
"AutoPhysics": true,
|
||||
"BrakePowerMax": 3000,
|
||||
"CamberAngle": -3,
|
||||
"CamberAngle": 0,
|
||||
"CasterAngle": 0,
|
||||
"IsFront": false,
|
||||
"Mass": 30,
|
||||
@@ -5209,8 +5217,8 @@
|
||||
"SpringStrength": 2800,
|
||||
"SteerMultiplier": 0,
|
||||
"SuspensionLength": 5,
|
||||
"TirePreset": "frictions/default.tire",
|
||||
"ToeAngle": -0.5,
|
||||
"WheelFriction": "frictions/high-performance road tire.whfric",
|
||||
"Width": 9
|
||||
}
|
||||
],
|
||||
@@ -5241,6 +5249,7 @@
|
||||
"CreateBoneObjects": false,
|
||||
"MaterialGroup": null,
|
||||
"MaterialOverride": null,
|
||||
"Materials": null,
|
||||
"Model": "models/laurel_c33_root/wheel.vmdl",
|
||||
"Morphs": {},
|
||||
"OnComponentDestroy": null,
|
||||
@@ -5296,9 +5305,10 @@
|
||||
"__type": "VeloX.VeloXWheel",
|
||||
"__guid": "52e26121-2451-4373-b101-a2d7a4e51a09",
|
||||
"__enabled": true,
|
||||
"Ackermann": 0,
|
||||
"AutoPhysics": true,
|
||||
"BrakePowerMax": 3000,
|
||||
"CamberAngle": 3,
|
||||
"CamberAngle": 0,
|
||||
"CasterAngle": 0,
|
||||
"IsFront": false,
|
||||
"Mass": 30,
|
||||
@@ -5315,8 +5325,8 @@
|
||||
"SpringStrength": 2800,
|
||||
"SteerMultiplier": 0,
|
||||
"SuspensionLength": 5,
|
||||
"TirePreset": "frictions/default.tire",
|
||||
"ToeAngle": 0.5,
|
||||
"WheelFriction": "frictions/high-performance road tire.whfric",
|
||||
"Width": 9
|
||||
}
|
||||
],
|
||||
@@ -5347,6 +5357,7 @@
|
||||
"CreateBoneObjects": false,
|
||||
"MaterialGroup": null,
|
||||
"MaterialOverride": null,
|
||||
"Materials": null,
|
||||
"Model": "models/laurel_c33_root/wheel.vmdl",
|
||||
"Morphs": {},
|
||||
"OnComponentDestroy": null,
|
||||
@@ -5418,7 +5429,6 @@
|
||||
"__type": "VeloX.Powertrain.Engine",
|
||||
"__guid": "0bc0d7ab-0688-4447-bb86-271c960a4cd8",
|
||||
"__enabled": true,
|
||||
"FrictionCoeff": 0.01,
|
||||
"IdleRPM": 900,
|
||||
"Inertia": 0.151,
|
||||
"Input": null,
|
||||
@@ -5438,35 +5448,35 @@
|
||||
"component_type": "Clutch"
|
||||
},
|
||||
"RPMPercent": 0,
|
||||
"StartFriction": -10,
|
||||
"Stream": "sounds/streams/v8_c63/v8_c63.engstr",
|
||||
"TorqueMap": {
|
||||
"rangey": "0,200",
|
||||
"rangex": "-0.00000002980232,0.3320917",
|
||||
"rangey": "217.2734,654.8591",
|
||||
"frames": [
|
||||
{
|
||||
"x": 0,
|
||||
"y": 0.3537234,
|
||||
"y": 0.009551144,
|
||||
"in": 0,
|
||||
"out": 0,
|
||||
"mode": "Mirrored"
|
||||
},
|
||||
{
|
||||
"x": 0.28374237,
|
||||
"y": 0.7368113,
|
||||
"x": 0.22468804,
|
||||
"y": 1,
|
||||
"in": -1.2474353,
|
||||
"out": 1.2474353,
|
||||
"mode": "Mirrored"
|
||||
},
|
||||
{
|
||||
"x": 0.61809814,
|
||||
"y": 0.9946808,
|
||||
"x": 0.80034494,
|
||||
"y": 0.9870826,
|
||||
"in": 0.22950783,
|
||||
"out": -0.22950783,
|
||||
"mode": "Mirrored"
|
||||
},
|
||||
{
|
||||
"x": 1,
|
||||
"y": 0.125,
|
||||
"y": 0,
|
||||
"in": 0,
|
||||
"out": 0,
|
||||
"mode": "Mirrored"
|
||||
@@ -5608,7 +5618,6 @@
|
||||
"__guid": "57ceb391-79ea-4d2d-a27f-cdd3c18e5789",
|
||||
"__enabled": true,
|
||||
"BiasAB": 0.5,
|
||||
"CoastRamp": 1,
|
||||
"FinalDrive": 3.392,
|
||||
"Inertia": 0.01,
|
||||
"Input": {
|
||||
@@ -5635,10 +5644,6 @@
|
||||
"go": "df6aec6f-b56f-4696-bd56-ffc02fc99bd3",
|
||||
"component_type": "PowerWheel"
|
||||
},
|
||||
"PowerRamp": 1,
|
||||
"SlipTorque": 0,
|
||||
"SteerLock": 45,
|
||||
"Stiffness": 0.1,
|
||||
"Vehicle": {
|
||||
"_type": "component",
|
||||
"component_id": "03e04bce-db7b-4547-9cfd-0364849bdb33",
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Submodule Libraries/meteorlab.velox updated: 964b46e1c5...0905876b99
@@ -5,7 +5,9 @@
|
||||
"world": "Collide",
|
||||
"trigger": "Trigger",
|
||||
"ladder": "Ignore",
|
||||
"water": "Trigger"
|
||||
"water": "Trigger",
|
||||
"car": "Unset",
|
||||
"wheel": "Unset"
|
||||
},
|
||||
"Pairs": [
|
||||
{
|
||||
@@ -27,6 +29,11 @@
|
||||
"a": "playerclip",
|
||||
"b": "solid",
|
||||
"r": "Collide"
|
||||
},
|
||||
{
|
||||
"a": "car",
|
||||
"b": "wheel",
|
||||
"r": "Ignore"
|
||||
}
|
||||
],
|
||||
"__guid": "514752eb-3865-44d9-9224-8cb6b4113543",
|
||||
|
||||
73
ProjectSettings/Mixer.config
Normal file
73
ProjectSettings/Mixer.config
Normal file
@@ -0,0 +1,73 @@
|
||||
{
|
||||
"Version": 2,
|
||||
"Mixers": {
|
||||
"Guid": "b45ae2d8-e4c0-4b2a-b194-597b18b4827e",
|
||||
"Name": "Master",
|
||||
"Volume": 1,
|
||||
"Mute": false,
|
||||
"Solo": false,
|
||||
"Spacializing": 1,
|
||||
"MaxVoices": 64,
|
||||
"DistanceAttenuation": 1,
|
||||
"Occlusion": 1,
|
||||
"AirAbsorption": 1,
|
||||
"OverrideOcclusion": false,
|
||||
"OcclusionTags": null,
|
||||
"Processors": [],
|
||||
"Children": [
|
||||
{
|
||||
"Guid": "44e86291-3961-48d8-87f8-b1573a916e4d",
|
||||
"Name": "Music",
|
||||
"Volume": 1,
|
||||
"Mute": false,
|
||||
"Solo": false,
|
||||
"Spacializing": 0,
|
||||
"MaxVoices": 64,
|
||||
"DistanceAttenuation": 0,
|
||||
"Occlusion": 0,
|
||||
"AirAbsorption": 0,
|
||||
"OverrideOcclusion": false,
|
||||
"OcclusionTags": null,
|
||||
"Processors": [],
|
||||
"Children": []
|
||||
},
|
||||
{
|
||||
"Guid": "44b2366a-4500-400e-b4ad-f370bb438938",
|
||||
"Name": "Game",
|
||||
"Volume": 1,
|
||||
"Mute": false,
|
||||
"Solo": false,
|
||||
"Spacializing": 1,
|
||||
"MaxVoices": 64,
|
||||
"DistanceAttenuation": 1,
|
||||
"Occlusion": 1,
|
||||
"AirAbsorption": 1,
|
||||
"OverrideOcclusion": false,
|
||||
"OcclusionTags": null,
|
||||
"IsDefault": true,
|
||||
"Processors": [],
|
||||
"Children": []
|
||||
},
|
||||
{
|
||||
"Guid": "52215754-116c-4aee-bf1b-8d3d70717abc",
|
||||
"Name": "UI",
|
||||
"Volume": 1,
|
||||
"Mute": false,
|
||||
"Solo": false,
|
||||
"Spacializing": 0,
|
||||
"MaxVoices": 64,
|
||||
"DistanceAttenuation": 0,
|
||||
"Occlusion": 0,
|
||||
"AirAbsorption": 0,
|
||||
"OverrideOcclusion": false,
|
||||
"OcclusionTags": null,
|
||||
"Processors": [],
|
||||
"Children": []
|
||||
}
|
||||
]
|
||||
},
|
||||
"__guid": "7053fdaf-c120-498c-ae34-7b69b3432396",
|
||||
"__schema": "configdata",
|
||||
"__type": "MixerSettings",
|
||||
"__version": 2
|
||||
}
|
||||
10
ProjectSettings/Physics.config
Normal file
10
ProjectSettings/Physics.config
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"UseFixedUpdate": true,
|
||||
"SubSteps": 1,
|
||||
"FixedUpdateFrequency": 66,
|
||||
"MaxFixedUpdates": 2,
|
||||
"__guid": "ae9ab42d-3820-4c8c-8cb3-bea5c8e5a7a6",
|
||||
"__schema": "configdata",
|
||||
"__type": "PhysicsSettings",
|
||||
"__version": 1
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Numerics;
|
||||
using System.Text;
|
||||
using System.Threading.Channels;
|
||||
using System.Threading.Tasks;
|
||||
@@ -19,7 +20,9 @@ namespace Sandbox
|
||||
[Property] VeloXCar Car { get; set; }
|
||||
[Property] public Vector3 CameraOffset { get; set; }
|
||||
|
||||
private Angles EyeAngles { get; set; }
|
||||
public float blendSpeed = 10f;
|
||||
private Angles EyeAngles = new( 0, 180, 0 );
|
||||
private Rotation targetRotation;
|
||||
|
||||
protected override void OnUpdate()
|
||||
{
|
||||
@@ -34,7 +37,7 @@ namespace Sandbox
|
||||
|
||||
Angles input = Input.AnalogLook;
|
||||
Angles eyeAngles = EyeAngles;
|
||||
eyeAngles += input;
|
||||
eyeAngles += input.WithPitch( -input.pitch );
|
||||
eyeAngles.roll = 0f;
|
||||
|
||||
eyeAngles.pitch = eyeAngles.pitch.Clamp( 0f - 89, 89 );
|
||||
@@ -46,8 +49,18 @@ namespace Sandbox
|
||||
{
|
||||
|
||||
var cam = Scene.Camera;
|
||||
cam.WorldRotation = EyeAngles;
|
||||
cam.WorldPosition = WorldPosition + Vector3.Up * CameraOffset.z + cam.WorldRotation.Backward * CameraOffset.x;
|
||||
|
||||
var zoffset = Vector3.Up * CameraOffset.z;
|
||||
Vector3 targetPos = WorldPosition + zoffset + WorldRotation * EyeAngles * CameraOffset;
|
||||
float blendFactor = blendSpeed * Time.Delta;
|
||||
blendFactor = MathF.Min( blendFactor, 1f );
|
||||
cam.WorldPosition = Vector3.Lerp( cam.WorldPosition, targetPos, blendFactor );
|
||||
|
||||
Vector3 lookDirection = WorldPosition + zoffset - cam.WorldPosition;
|
||||
if ( lookDirection != Vector3.Zero )
|
||||
targetRotation = Rotation.LookAt( lookDirection, Vector3.Up );
|
||||
|
||||
cam.WorldRotation = targetRotation;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user