-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 4149080
Showing
7 changed files
with
87 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
HeadtrackingCameraSuspension = {} | ||
|
||
function HeadtrackingCameraSuspension.prerequisitesPresent(specializations) | ||
return true | ||
end | ||
|
||
function HeadtrackingCameraSuspension.registerEventListeners(vehicleType) | ||
-- print("HeadtrackingCameraSuspension.registerEventListeners"); | ||
SpecializationUtil.registerEventListener(vehicleType, "onLoad", HeadtrackingCameraSuspension); | ||
end | ||
|
||
|
||
function HeadtrackingCameraSuspension:onLoad(savegame) | ||
-- print("HeadtrackingCameraSuspension:onLoad") | ||
VehicleCamera.onActiveCameraSuspensionSettingChanged = Utils.overwrittenFunction(VehicleCamera.onActiveCameraSuspensionSettingChanged, HeadtrackingCameraSuspension.onActiveCameraSuspensionSettingChanged) | ||
end | ||
|
||
---Called when camera suspension setting has changed | ||
-- @param bool newState new setting state | ||
function HeadtrackingCameraSuspension:onActiveCameraSuspensionSettingChanged(superFunc, newState) | ||
-- print("VehicleCamera:onActiveCameraSuspensionSettingChanged") | ||
|
||
if self.suspensionNode ~= nil then | ||
if self.lastActiveCameraSuspensionSetting ~= newState then | ||
if newState then | ||
link(self.cameraSuspensionParentNode, self.cameraPositionNode) | ||
else | ||
link(self.cameraBaseParentNode, self.cameraPositionNode) | ||
end | ||
|
||
-- Update headTrackingNode | ||
if self.headTrackingNode ~= nil then | ||
link(getParent(self.cameraPositionNode), self.headTrackingNode) | ||
end | ||
|
||
self.lastActiveCameraSuspensionSetting = newState | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
if g_specializationManager:getSpecializationByName("headtrackingCameraSuspension") == nil then | ||
g_specializationManager:addSpecialization( | ||
"headtrackingCameraSuspension", | ||
"HeadtrackingCameraSuspension", | ||
Utils.getFilename("HeadtrackingCameraSuspension.lua", | ||
g_currentModDirectory), | ||
true | ||
) | ||
end | ||
|
||
for typeName, typeEntry in pairs(g_vehicleTypeManager.types) do | ||
if | ||
|
||
SpecializationUtil.hasSpecialization(Enterable, typeEntry.specializations) | ||
|
||
|
||
then | ||
g_vehicleTypeManager:addSpecialization(typeName, "headtrackingCameraSuspension") | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Headtracking Camera Suspension | ||
|
||
This is a mod for Farming Simulator 22. | ||
|
||
If you are playing with headtracking in the current version of the game you will have no dynamic camera suspension, even if enabled in the settings. This mod fixes this problem. | ||
|
||
--- | ||
|
||
Dies ist ein Mod für den Farming Simulator 22 | ||
|
||
Wenn du mit Headtracking spielst, funktioniert in der aktuellen Spielversion die dynamische Kamera (federnde Sitzkamera) nicht, selbst wenn man dies in den Einstellungen aktiviert. Dieser Mod behebt dieses Problem. |
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="utf-8" standalone="no" ?> | ||
<modDesc descVersion="61"> | ||
<author>CptCray</author> | ||
<version>1.0.0.0</version> | ||
<title> | ||
<en>Headtracking Camera Suspension</en> | ||
</title> | ||
<description> | ||
<en><![CDATA[Headtracking Camera Suspension]]></en> | ||
</description> | ||
<iconFilename>icon.dds</iconFilename> | ||
<multiplayer supported="true"/> | ||
|
||
<extraSourceFiles> | ||
<sourceFile filename="HeadtrackingCameraSuspensionRegister.lua"/> | ||
</extraSourceFiles> | ||
</modDesc> |