Skip to content

Commit

Permalink
* added changes from our internal VCS, Revision: 55597
Browse files Browse the repository at this point in the history
  • Loading branch information
OndrejPetrzilka committed May 28, 2015
1 parent 3ee0659 commit dc06ae9
Show file tree
Hide file tree
Showing 109 changed files with 1,459 additions and 1,164 deletions.
Binary file modified 3rd/HavokWrapper_SE/release/x86/HavokWrapper.dll
Binary file not shown.
3 changes: 0 additions & 3 deletions Sources/Sandbox.Common/ModAPI/IMyEntities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ public interface IMyEntities
IMyEntity GetEntityById(long entityId);
bool EntityExists(long entityId);
IMyEntity GetEntityByName(string name);
void SetTypeSelectable(Type type, bool selectable);
bool IsTypeSelectable(Type type);
bool IsSelectable(IMyEntity entity);
void SetTypeHidden(Type type, bool hidden);
bool IsTypeHidden(Type type);
bool IsVisible(IMyEntity entity);
Expand Down
3 changes: 0 additions & 3 deletions Sources/Sandbox.Common/ModAPI/IMyEntity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,6 @@ public interface IMyEntity
bool InScene { get; set; }
bool InvalidateOnMove { get; }
bool IsCCDForProjectiles { get; }
bool IsSelectable();
bool IsSelectableAsChild();
bool IsSelectableParentOnly();
bool IsVisible();
bool IsVolumetric { get; }

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Sandbox.Common.ObjectBuilders.Definitions;
using Sandbox.Common.ModAPI;
using Sandbox.Common.ObjectBuilders.Definitions;
using System;
using System.Collections.Generic;
using System.Linq;
Expand All @@ -9,7 +10,7 @@ namespace Sandbox.ModAPI.Interfaces
public interface IMyDestroyableObject
{
void OnDestroy();
void DoDamage(float damage, MyDamageType damageType, bool sync);
void DoDamage(float damage, MyDamageType damageType, bool sync, MyHitInfo? hitInfo = null);
float Integrity { get; }
}
}
22 changes: 22 additions & 0 deletions Sources/Sandbox.Common/ModAPI/MyHitInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using ProtoBuf;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using VRageMath;

namespace Sandbox.Common.ModAPI
{
[ProtoContract]
public struct MyHitInfo
{
[ProtoMember]
public Vector3D Position;

[ProtoMember]
public Vector3D Normal;

[ProtoMember]
public Vector3D Velocity; //of impacting entity/bulet, normalize to get direction
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@ public class MyBBMemoryTarget : MyBBMemoryValue
[ProtoMember]
public int? TreeId = null;

[ProtoMember]
public Vector3I? VoxelPosition = null;

public Vector3I BlockPosition { get { return Vector3I.Round(Position.Value); } }
public Vector3I VoxelPosition { get { return Vector3I.Round(Position.Value); } }

public MyBBMemoryTarget()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,9 @@ public class MyObjectBuilder_CharacterDefinition : MyObjectBuilder_DefinitionBas
[ProtoMember, XmlArrayItem("BoneSet")]
public MyBoneSetDefinition[] RagdollBonesMappings;

[ProtoMember, XmlArrayItem("BoneSet")]
public MyBoneSetDefinition[] RagdollPartialSimulations;

[ProtoMember]
public float OxygenConsumption = 10f;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ public class MyObjectBuilder_PhysicalModelDefinition : MyObjectBuilder_Definitio
public string PhysicalMaterial;

[ProtoMember]
public float Mass;
public float Mass = 0;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,8 @@ public class MyVoxelMiningDefinition
[ProtoMember, DefaultValue(0)]
public float CuttingEfficiency = 0;

[ProtoMember, DefaultValue(0)]
public float BuildingEfficiency = 0;

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,5 @@ public class MyObjectBuilder_GuiBlockCategoryDefinition : MyObjectBuilder_Defini

[ProtoMember]
public bool ShowAnimations = false;

[ProtoMember]
public bool Public = true;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using ProtoBuf;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using VRageMath;

namespace Sandbox.Common.ObjectBuilders
{
[ProtoContract]
[MyObjectBuilderDefinition]
public class MyObjectBuilder_AutopilotWaypoint : MyObjectBuilder_Base
{
[ProtoMember]
public Vector3D Coords;

[ProtoMember]
public string Name;

[ProtoMember, DefaultValue(null)]
public List<MyObjectBuilder_ToolbarItem> Actions = null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
using VRage.Utils;
using VRage.Plugins;
using Sandbox.Common.ObjectBuilders.Serializer;
using VRage.Utils;
using VRage.Library.Utils;

namespace Sandbox.Common.ObjectBuilders
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,6 @@ public enum MyCameraControllerEnum
SpectatorFixed,
}

[Obsolete("For compatibility")]
public enum MySessionHarvestMode
{
REALISTIC = 0,
TEN_TIMES = 1,
FIFTY_TIMES = 2,
CREATIVE = 3
}

[Obsolete("For compatibility")]
public enum MySessionGameType
{
SURVIVAL = MySessionHarvestMode.REALISTIC,
THREE_TIMES = MySessionHarvestMode.TEN_TIMES,
TEN_TIMES = MySessionHarvestMode.FIFTY_TIMES,
CREATIVE = MySessionHarvestMode.CREATIVE
}

[ProtoContract]
[MyObjectBuilderDefinition]
public class MyObjectBuilder_Checkpoint : MyObjectBuilder_Base
Expand Down Expand Up @@ -120,23 +102,6 @@ public MyOnlineModeEnum OnlineMode
}
public bool ShouldSerializeOnlineMode() { return false; }

/// <summary>
/// This member is obsolete. Use GameType instead.
/// </summary>
//[ProtoMember]
public MySessionHarvestMode HarvestMode
{
set
{
GameType = (MySessionGameType)value;
}
get
{
Debug.Assert(false, "Should not call getter on Harvest mode. Harvest mode is obsolete. Use GameType instead.");
return MySessionHarvestMode.REALISTIC;
}
}
public bool ShouldSerializeHarvestMode() { return false; }

//[ProtoMember]
//public MySessionHardwareRequirements HardwareRequirements;
Expand Down Expand Up @@ -279,54 +244,7 @@ public bool ShowPlayerNamesOnHud
}
public bool ShouldSerializeShowPlayerNamesOnHud() { return false; }

//[ProtoMember]
public MySessionGameType GameType
{
set
{
switch (value)
{
case MySessionGameType.CREATIVE:
GameMode = MyGameModeEnum.Creative;
InventorySizeMultiplier = 1;
AssemblerSpeedMultiplier = 1;
AssemblerEfficiencyMultiplier = 1;
RefinerySpeedMultiplier = 1;
break;

case MySessionGameType.SURVIVAL:
GameMode = MyGameModeEnum.Survival;
InventorySizeMultiplier = 1;
AssemblerSpeedMultiplier = 1;
AssemblerEfficiencyMultiplier = 1;
RefinerySpeedMultiplier = 1;
break;

case MySessionGameType.THREE_TIMES:
GameMode = MyGameModeEnum.Survival;
InventorySizeMultiplier = 3;
AssemblerSpeedMultiplier = 3;
AssemblerEfficiencyMultiplier = 3;
RefinerySpeedMultiplier = 1; // This was always 1 when MySessionGameType was used
break;

case MySessionGameType.TEN_TIMES:
GameMode = MyGameModeEnum.Survival;
InventorySizeMultiplier = 10;
AssemblerSpeedMultiplier = 10;
AssemblerEfficiencyMultiplier = 10;
RefinerySpeedMultiplier = 1; // This was always 1 when MySessionGameType was used
break;
}
}
get
{
Debug.Fail("Should not call getter on GameType. Game type is obsolete. Use Game mode and multipliers instead.");
return MySessionGameType.SURVIVAL;
}
}
public bool ShouldSerializeGameType() { return false; }


//[ProtoMember, DefaultValue(256)]
public short MaxFloatingObjects
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ public class MyObjectBuilder_Projector : MyObjectBuilder_FunctionalBlock
public Vector3I ProjectionRotation;
[ProtoMember]
public bool KeepProjection = false;
[ProtoMember]
public bool ShowOnlyBuildable = false;

public override void Remap(IMyRemapHelper remapHelper)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using ProtoBuf;
using System.Collections.Generic;
using System.ComponentModel;
using VRageMath;

namespace Sandbox.Common.ObjectBuilders
Expand All @@ -8,26 +9,39 @@ namespace Sandbox.Common.ObjectBuilders
[MyObjectBuilderDefinition]
public class MyObjectBuilder_RemoteControl : MyObjectBuilder_ShipController
{
[ProtoMember(1)]
[ProtoMember]
public long? PreviousControlledEntityId = null;

[ProtoMember(2)]
[ProtoMember]
public bool AutoPilotEnabled;

[ProtoMember(3)]
[ProtoMember]
public int FlightMode;

[ProtoMember(4)]
public List<Vector3D> Coords;

[ProtoMember(5)]
public List<string> Names;

[ProtoMember(6)]
[ProtoMember]
public int CurrentWaypointIndex = -1;

[ProtoMember(7)]
public MyObjectBuilder_Toolbar AutoPilotToolbar;
[ProtoMember]
public List<MyObjectBuilder_AutopilotWaypoint> Waypoints;

/// <summary>
/// Obsolete. Use Waypoints instead.
/// </summary>
[ProtoMember, DefaultValue(null)]
public List<Vector3D> Coords = null;

/// <summary>
/// Obsolete. Use Waypoints instead.
/// </summary>
[ProtoMember, DefaultValue(null)]
public List<string> Names = null;

/// <summary>
/// Obsolete. Use Waypoints instead.
/// </summary>
[ProtoMember, DefaultValue(null)]
public MyObjectBuilder_Toolbar AutoPilotToolbar = null;

public override void Remap(IMyRemapHelper remapHelper)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@ public class MyObjectBuilder_TurretBase : MyObjectBuilder_UserControllableGun
[ProtoMember]
public float Elevation;

[ProtoMember]
public bool IsShooting;

[ProtoMember]
public MyObjectBuilder_GunBase GunBase;

Expand Down
2 changes: 2 additions & 0 deletions Sources/Sandbox.Common/Sandbox.Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@
<Compile Include="ModAPI\Interfaces\ITerminalProperty.cs" />
<Compile Include="ModAPI\Interfaces\ITerminalAction.cs" />
<Compile Include="ModAPI\MyAPIGateway.cs" />
<Compile Include="ModAPI\MyHitInfo.cs" />
<Compile Include="Models\IMyTriangePruningStructure.cs" />
<Compile Include="Models\MyIntersectionResultLineTriangle.cs" />
<Compile Include="Models\MyMesh.cs" />
Expand Down Expand Up @@ -360,6 +361,7 @@
<Compile Include="ObjectBuilders\MyCharacterName.cs" />
<Compile Include="ObjectBuilders\MyObjectBuilder_AirtightDoorGeneric.cs" />
<Compile Include="ObjectBuilders\MyObjectBuilder_AirtightHangarDoor.cs" />
<Compile Include="ObjectBuilders\MyObjectBuilder_AutopilotWaypoint.cs" />
<Compile Include="ObjectBuilders\MyObjectBuilder_BlockItem.cs" />
<Compile Include="ObjectBuilders\MyObjectBuilder_AreaMarker.cs" />
<Compile Include="ObjectBuilders\MyObjectBuilder_CryoChamber.cs" />
Expand Down
7 changes: 7 additions & 0 deletions Sources/Sandbox.Game/Definitions/MyCharacterDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ public class MyCharacterDefinition : MyDefinitionBase
// Ragdoll data
public string RagdollDataFile;
public Dictionary<string, string[]> RagdollBonesMappings = new Dictionary<string, string[]>();
public Dictionary<string, string[]> RagdollPartialSimulations = new Dictionary<string, string[]>();

public string RagdollRootBody;

public Dictionary<MyCharacterMovementEnum, MyFeetIKSettings> FeetIKSettings;
Expand Down Expand Up @@ -199,6 +201,11 @@ protected override void Init(MyObjectBuilder_DefinitionBase objectBuilder)
RagdollBonesMappings = builder.RagdollBonesMappings.ToDictionary(x => x.Name, x => x.Bones.Split(' '));
}

if (builder.RagdollPartialSimulations != null)
{
RagdollPartialSimulations = builder.RagdollPartialSimulations.ToDictionary(x => x.Name, x => x.Bones.Split(' '));
}

Mass = builder.Mass;
MaxHealth = builder.MaxHealth;
OxygenCapacity = builder.OxygenCapacity;
Expand Down
3 changes: 2 additions & 1 deletion Sources/Sandbox.Game/Definitions/MyCubeBlockDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,8 @@ protected override void Init(MyObjectBuilder_DefinitionBase builder)
MaxIntegrity = integrity;
IntegrityPointsPerSec = integrity / ob.BuildTimeSeconds;
DisassembleRatio = ob.DisassembleRatio;
Mass = mass;
if(!MyPerGameSettings.Destruction)
Mass = mass;
}

CriticalIntegrityRatio = criticalIntegrity / MaxIntegrity;
Expand Down
Loading

0 comments on commit dc06ae9

Please sign in to comment.