Compare commits

...

9 Commits

Author SHA1 Message Date
Valera
7697572fa2 module 2025-07-18 16:05:59 +07:00
Valera
5fd44bb600 update 2025-07-18 16:05:48 +07:00
Valera
a662f35fcd update 2025-06-16 14:46:53 +07:00
Valera
ba2fed871d update 2025-06-15 22:00:08 +07:00
Valera
2828355b82 not work 2025-06-15 03:23:49 +07:00
Valera
5b9fdf1a25 not work 2025-06-15 03:23:47 +07:00
Valera
969c8e3bd0 new car camera 2025-06-14 18:21:37 +07:00
Valera
265af16061 submodule upd 2025-06-13 21:16:28 +07:00
Valera
1f2fb7b962 new powertrain смерть чуркам 2025-06-13 21:16:20 +07:00
7 changed files with 2254 additions and 45 deletions

View File

@@ -32,24 +32,12 @@
"go": "88ba51ec-9552-4022-a23e-0fb53b88afec",
"component_type": "ModelCollider"
},
"CounterSteer": 0.1,
"DifferentialRatio": 0.5,
"Driver": null,
"EngineBrakeTorque": 2000,
"EngineState": "Running",
"FlywheelFriction": -6000,
"FlyWheelMass": 80,
"FlyWheelRadius": 0.5,
"FlywheelTorque": 20000,
"Gears": {
"-1": 2.5,
"0": 0,
"1": 2.8,
"2": 1.7,
"3": 1.2,
"4": 0.9,
"5": 0.75,
"6": 0.7
"CounterSteer": 0,
"Engine": {
"_type": "component",
"component_id": "0bc0d7ab-0688-4447-bb86-271c960a4cd8",
"go": "2059775f-8b05-4f02-b82c-f8b6e1763607",
"component_type": "Engine"
},
"HardCollisionSound": "sounds/collisions/car_heavy.sound",
"Input": {
@@ -59,33 +47,27 @@
"AnalogLook": "0,0,0",
"AnalogMove": "0,0,0"
},
"IsDriver": false,
"Mass": 1100,
"MaxRPM": 7000,
"MaxRPMTorque": 8000,
"MaxSteerAngle": 35,
"MetalImpactEffect": {
"_type": "gameobject",
"prefab": "effects/metal_impact.prefab"
},
"MinRPM": 800,
"MinRPMTorque": 5000,
"OnComponentDestroy": null,
"OnComponentDisabled": null,
"OnComponentEnabled": null,
"OnComponentFixedUpdate": null,
"OnComponentStart": null,
"OnComponentUpdate": null,
"PowerDistribution": -1,
"SoftCollisionSound": "sounds/collisions/car_light.sound",
"SteerConeChangeRate": 8,
"SteerConeMaxAngle": 0.25,
"SteerConeMaxSpeed": 1800,
"Stream": "sounds/streams/v8_c63/v8_c63.engstr",
"SuspensionDownSound": "sounds/suspension/pneumatic_down.sound",
"SuspensionHeavySound": "sounds/suspension/compress_heavy.sound",
"SuspensionUpSound": "sounds/suspension/pneumatic_up.sound",
"Throttle": 0,
"TransmissionEfficiency": 0.8,
"VehicleScrapeSound": "sounds/collisions/metal_scrape.sound",
"WheelIgnoredTags": null,
"Wheels": [
@@ -130,7 +112,7 @@
"Yaw": false,
"Roll": false
},
"MassCenterOverride": "0,0,0",
"MassCenterOverride": "5,0,25",
"MassOverride": 0,
"MotionEnabled": true,
"OnComponentDestroy": null,
@@ -139,7 +121,7 @@
"OnComponentFixedUpdate": null,
"OnComponentStart": null,
"OnComponentUpdate": null,
"OverrideMassCenter": false,
"OverrideMassCenter": true,
"RigidbodyFlags": 0,
"StartAsleep": false
},
@@ -152,7 +134,7 @@
"_type": "component",
"component_id": "03e04bce-db7b-4547-9cfd-0364849bdb33",
"go": "ddd1330f-ec64-48e9-9b48-f2b35f5bb712",
"component_type": null
"component_type": "VeloXCar"
},
"OnComponentDestroy": null,
"OnComponentDisabled": null,
@@ -189,6 +171,7 @@
"CreateBoneObjects": true,
"MaterialGroup": null,
"MaterialOverride": null,
"Materials": null,
"Model": "models/laurel_c33_root/laurel_c33_root.vmdl",
"Morphs": {},
"OnComponentDestroy": null,
@@ -224,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",
@@ -237,6 +221,7 @@
"OnObjectTriggerExit": null,
"OnTriggerEnter": null,
"OnTriggerExit": null,
"RollingResistance": null,
"Static": false,
"Surface": null,
"SurfaceVelocity": "0,0,0"
@@ -4996,9 +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,
@@ -5014,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
}
],
@@ -5046,6 +5033,7 @@
"CreateBoneObjects": false,
"MaterialGroup": null,
"MaterialOverride": null,
"Materials": null,
"Model": "models/laurel_c33_root/wheel.vmdl",
"Morphs": {},
"OnComponentDestroy": null,
@@ -5101,9 +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,
@@ -5119,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
}
],
@@ -5151,6 +5141,7 @@
"CreateBoneObjects": false,
"MaterialGroup": null,
"MaterialOverride": null,
"Materials": null,
"Model": "models/laurel_c33_root/wheel.vmdl",
"Morphs": {},
"OnComponentDestroy": null,
@@ -5206,8 +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,
@@ -5224,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
}
],
@@ -5256,6 +5249,7 @@
"CreateBoneObjects": false,
"MaterialGroup": null,
"MaterialOverride": null,
"Materials": null,
"Model": "models/laurel_c33_root/wheel.vmdl",
"Morphs": {},
"OnComponentDestroy": null,
@@ -5311,8 +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,
@@ -5329,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
}
],
@@ -5361,6 +5357,7 @@
"CreateBoneObjects": false,
"MaterialGroup": null,
"MaterialOverride": null,
"Materials": null,
"Model": "models/laurel_c33_root/wheel.vmdl",
"Morphs": {},
"OnComponentDestroy": null,
@@ -5396,6 +5393,373 @@
"Children": []
}
]
},
{
"__guid": "a50b774c-47ed-49f5-a09a-de728e1d645f",
"__version": 1,
"Flags": 0,
"Name": "powertrain",
"Position": "0,0,0",
"Rotation": "0,0,0,1",
"Scale": "1,1,1",
"Tags": "",
"Enabled": true,
"NetworkMode": 2,
"NetworkInterpolation": true,
"NetworkOrphaned": 0,
"OwnerTransfer": 1,
"Components": [],
"Children": [
{
"__guid": "2059775f-8b05-4f02-b82c-f8b6e1763607",
"__version": 1,
"Flags": 0,
"Name": "engine",
"Position": "0,0,0",
"Rotation": "0,0,0,1",
"Scale": "1,1,1",
"Tags": "",
"Enabled": true,
"NetworkMode": 2,
"NetworkInterpolation": true,
"NetworkOrphaned": 0,
"OwnerTransfer": 1,
"Components": [
{
"__type": "VeloX.Powertrain.Engine",
"__guid": "0bc0d7ab-0688-4447-bb86-271c960a4cd8",
"__enabled": true,
"IdleRPM": 900,
"Inertia": 0.151,
"Input": null,
"IsRedlining": false,
"LimiterDuration": 0.06,
"MaxRPM": 7000,
"OnComponentDestroy": null,
"OnComponentDisabled": null,
"OnComponentEnabled": null,
"OnComponentFixedUpdate": null,
"OnComponentStart": null,
"OnComponentUpdate": null,
"Output": {
"_type": "component",
"component_id": "998fc1ee-980e-49ec-9d87-8b5a655438a1",
"go": "96015233-8e68-445d-9361-b268afba55e6",
"component_type": "Clutch"
},
"RPMPercent": 0,
"Stream": "sounds/streams/v8_c63/v8_c63.engstr",
"TorqueMap": {
"rangex": "-0.00000002980232,0.3320917",
"rangey": "217.2734,654.8591",
"frames": [
{
"x": 0,
"y": 0.009551144,
"in": 0,
"out": 0,
"mode": "Mirrored"
},
{
"x": 0.22468804,
"y": 1,
"in": -1.2474353,
"out": 1.2474353,
"mode": "Mirrored"
},
{
"x": 0.80034494,
"y": 0.9870826,
"in": 0.22950783,
"out": -0.22950783,
"mode": "Mirrored"
},
{
"x": 1,
"y": 0,
"in": 0,
"out": 0,
"mode": "Mirrored"
}
]
},
"Vehicle": {
"_type": "component",
"component_id": "03e04bce-db7b-4547-9cfd-0364849bdb33",
"go": "ddd1330f-ec64-48e9-9b48-f2b35f5bb712",
"component_type": "VeloXCar"
}
}
],
"Children": [
{
"__guid": "96015233-8e68-445d-9361-b268afba55e6",
"__version": 1,
"Flags": 0,
"Name": "clutch",
"Position": "0,0,0",
"Rotation": "0,0,0,1",
"Scale": "1,1,1",
"Tags": "",
"Enabled": true,
"NetworkMode": 2,
"NetworkInterpolation": true,
"NetworkOrphaned": 0,
"OwnerTransfer": 1,
"Components": [
{
"__type": "VeloX.Powertrain.Clutch",
"__guid": "998fc1ee-980e-49ec-9d87-8b5a655438a1",
"__enabled": true,
"Inertia": 0.002,
"Input": {
"_type": "component",
"component_id": "0bc0d7ab-0688-4447-bb86-271c960a4cd8",
"go": "2059775f-8b05-4f02-b82c-f8b6e1763607",
"component_type": "Engine"
},
"OnComponentDestroy": null,
"OnComponentDisabled": null,
"OnComponentEnabled": null,
"OnComponentFixedUpdate": null,
"OnComponentStart": null,
"OnComponentUpdate": null,
"Output": {
"_type": "component",
"component_id": "034c631f-2007-4a1d-916f-cb34ca7b72e6",
"go": "b9dd3824-3720-4628-a375-08061cd3acdb",
"component_type": "ManualGearbox"
},
"SlipTorque": 1000,
"Vehicle": {
"_type": "component",
"component_id": "03e04bce-db7b-4547-9cfd-0364849bdb33",
"go": "ddd1330f-ec64-48e9-9b48-f2b35f5bb712",
"component_type": "VeloXCar"
}
}
],
"Children": [
{
"__guid": "b9dd3824-3720-4628-a375-08061cd3acdb",
"__version": 1,
"Flags": 0,
"Name": "gearbox",
"Position": "0,0,0",
"Rotation": "0,0,0,1",
"Scale": "1,1,1",
"Tags": "",
"Enabled": true,
"NetworkMode": 2,
"NetworkInterpolation": true,
"NetworkOrphaned": 0,
"OwnerTransfer": 1,
"Components": [
{
"__type": "VeloX.Powertrain.ManualGearbox",
"__guid": "034c631f-2007-4a1d-916f-cb34ca7b72e6",
"__enabled": true,
"BackwardAction": "Attack2",
"ForwardAction": "Attack1",
"Inertia": 0.01,
"Input": {
"_type": "component",
"component_id": "998fc1ee-980e-49ec-9d87-8b5a655438a1",
"go": "96015233-8e68-445d-9361-b268afba55e6",
"component_type": "Clutch"
},
"OnComponentDestroy": null,
"OnComponentDisabled": null,
"OnComponentEnabled": null,
"OnComponentFixedUpdate": null,
"OnComponentStart": null,
"OnComponentUpdate": null,
"Output": {
"_type": "component",
"component_id": "57ceb391-79ea-4d2d-a27f-cdd3c18e5789",
"go": "36bec194-1145-4fcf-8b31-d17b220677ab",
"component_type": "OpenDifferential"
},
"Ratios": [
3.626,
2.2,
1.541,
1.213,
1,
0.767
],
"Reverse": 3.4,
"Vehicle": {
"_type": "component",
"component_id": "03e04bce-db7b-4547-9cfd-0364849bdb33",
"go": "ddd1330f-ec64-48e9-9b48-f2b35f5bb712",
"component_type": "VeloXCar"
}
}
],
"Children": [
{
"__guid": "36bec194-1145-4fcf-8b31-d17b220677ab",
"__version": 1,
"Flags": 0,
"Name": "differential",
"Position": "0,0,0",
"Rotation": "0,0,0,1",
"Scale": "1,1,1",
"Tags": "",
"Enabled": true,
"NetworkMode": 2,
"NetworkInterpolation": true,
"NetworkOrphaned": 0,
"OwnerTransfer": 1,
"Components": [
{
"__type": "VeloX.Powertrain.OpenDifferential",
"__guid": "57ceb391-79ea-4d2d-a27f-cdd3c18e5789",
"__enabled": true,
"BiasAB": 0.5,
"FinalDrive": 3.392,
"Inertia": 0.01,
"Input": {
"_type": "component",
"component_id": "034c631f-2007-4a1d-916f-cb34ca7b72e6",
"go": "b9dd3824-3720-4628-a375-08061cd3acdb",
"component_type": "ManualGearbox"
},
"OnComponentDestroy": null,
"OnComponentDisabled": null,
"OnComponentEnabled": null,
"OnComponentFixedUpdate": null,
"OnComponentStart": null,
"OnComponentUpdate": null,
"Output": {
"_type": "component",
"component_id": "f0bca53e-59f2-48fc-9e07-957b981a4722",
"go": "940beb4f-2f6b-4953-bd2d-312c7f4ede71",
"component_type": "PowerWheel"
},
"OutputB": {
"_type": "component",
"component_id": "3bf9fb99-0bbe-4fa4-b443-64349b2cd3f5",
"go": "df6aec6f-b56f-4696-bd56-ffc02fc99bd3",
"component_type": "PowerWheel"
},
"Vehicle": {
"_type": "component",
"component_id": "03e04bce-db7b-4547-9cfd-0364849bdb33",
"go": "ddd1330f-ec64-48e9-9b48-f2b35f5bb712",
"component_type": "VeloXCar"
}
}
],
"Children": [
{
"__guid": "940beb4f-2f6b-4953-bd2d-312c7f4ede71",
"__version": 1,
"Flags": 0,
"Name": "wheel left",
"Position": "0,0,0",
"Rotation": "0,0,0,1",
"Scale": "1,1,1",
"Tags": "",
"Enabled": true,
"NetworkMode": 2,
"NetworkInterpolation": true,
"NetworkOrphaned": 0,
"OwnerTransfer": 1,
"Components": [
{
"__type": "VeloX.Powertrain.PowerWheel",
"__guid": "f0bca53e-59f2-48fc-9e07-957b981a4722",
"__enabled": true,
"Inertia": 0.02,
"Input": {
"_type": "component",
"component_id": "57ceb391-79ea-4d2d-a27f-cdd3c18e5789",
"go": "36bec194-1145-4fcf-8b31-d17b220677ab",
"component_type": "OpenDifferential"
},
"OnComponentDestroy": null,
"OnComponentDisabled": null,
"OnComponentEnabled": null,
"OnComponentFixedUpdate": null,
"OnComponentStart": null,
"OnComponentUpdate": null,
"Output": null,
"Vehicle": {
"_type": "component",
"component_id": "03e04bce-db7b-4547-9cfd-0364849bdb33",
"go": "ddd1330f-ec64-48e9-9b48-f2b35f5bb712",
"component_type": "VeloXCar"
},
"Wheel": {
"_type": "component",
"component_id": "32fbede7-4c34-4f7d-8ec3-594774e693dc",
"go": "81fc7805-9643-48d0-b544-9ac5f52872ef",
"component_type": "VeloXWheel"
}
}
],
"Children": []
},
{
"__guid": "df6aec6f-b56f-4696-bd56-ffc02fc99bd3",
"__version": 1,
"Flags": 0,
"Name": "wheel right",
"Position": "0,0,0",
"Rotation": "0,0,0,1",
"Scale": "1,1,1",
"Tags": "",
"Enabled": true,
"NetworkMode": 2,
"NetworkInterpolation": true,
"NetworkOrphaned": 0,
"OwnerTransfer": 1,
"Components": [
{
"__type": "VeloX.Powertrain.PowerWheel",
"__guid": "3bf9fb99-0bbe-4fa4-b443-64349b2cd3f5",
"__enabled": true,
"Inertia": 0.02,
"Input": {
"_type": "component",
"component_id": "57ceb391-79ea-4d2d-a27f-cdd3c18e5789",
"go": "36bec194-1145-4fcf-8b31-d17b220677ab",
"component_type": "OpenDifferential"
},
"OnComponentDestroy": null,
"OnComponentDisabled": null,
"OnComponentEnabled": null,
"OnComponentFixedUpdate": null,
"OnComponentStart": null,
"OnComponentUpdate": null,
"Output": null,
"Vehicle": {
"_type": "component",
"component_id": "03e04bce-db7b-4547-9cfd-0364849bdb33",
"go": "ddd1330f-ec64-48e9-9b48-f2b35f5bb712",
"component_type": "VeloXCar"
},
"Wheel": {
"_type": "component",
"component_id": "52e26121-2451-4373-b101-a2d7a4e51a09",
"go": "93f0f744-1af2-46eb-a35a-894b10e0fdf0",
"component_type": "VeloXWheel"
}
}
],
"Children": []
}
]
}
]
}
]
}
]
}
]
}
],
"__properties": {

File diff suppressed because it is too large Load Diff

View File

@@ -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",

View 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
}

View 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
}

View File

@@ -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;
}
}
}