update component names, document heirarchy

This commit is contained in:
Aaron Kimbre 2023-06-08 10:29:17 -05:00
parent 9e9e4dc087
commit d11e2db887
22 changed files with 276 additions and 132 deletions

View File

@ -11,14 +11,14 @@ enum class eReplicaComponentType : uint32_t {
CHARACTER,
SCRIPT,
BOUNCER,
BUFF, // buff is really 98, this is DESTROYABLE
DESTROYABLE,
GHOST,
SKILL,
SPAWNER,
SPAWN,
ITEM,
REBUILD,
REBUILD_START,
REBUILD_ACTIVATOR,
MODULAR_BUILD,
BUILD_CONTROLLER,
BUILD_ACTIVATOR,
ICON_ONLY,
VENDOR,
INVENTORY,
@ -33,8 +33,8 @@ enum class eReplicaComponentType : uint32_t {
PET,
PLATFORM_BOUNDARY,
MODULE,
ARCADE,
VEHICLE_PHYSICS, // Havok demo based
JETPACKPAD,
HAVOK_VEHICLE_PHYSICS,
MOVEMENT_AI,
EXHIBIT,
OVERHEAD_ICON,
@ -46,23 +46,23 @@ enum class eReplicaComponentType : uint32_t {
SCRIPTED_ACTIVITY,
PHANTOM_PHYSICS,
SPRINGPAD,
MODEL,
MODEL_BEHAVIOR,
PROPERTY_ENTRANCE,
FX,
PROPERTY_MANAGEMENT,
VEHICLE_PHYSICS_NEW, // internal physics based on havok
VEHICLE_PHYSICS,
PHYSICS_SYSTEM,
QUICK_BUILD,
SWITCH,
ZONE_CONTROL, // Minigame
CHANGLING,
MINIGAME_CONTROL,
CHANGLING_BUILD,
CHOICE_BUILD,
PACKAGE,
SOUND_REPEATER,
SOUND_AMBIENT_2D,
SOUND_AMBIENT_3D,
PRECONDITION,
PLAYER_FLAG,
FLAG,
CUSTOM_BUILD_ASSEMBLY,
BASE_COMBAT_AI,
MODULE_ASSEMBLY,
@ -71,8 +71,8 @@ enum class eReplicaComponentType : uint32_t {
GENERIC_ACTIVATOR,
PROPERTY_VENDOR,
HF_LIGHT_DIRECTION_GADGET,
ROCKET_LAUNCH,
ROCKET_LANDING,
ROCKET_LAUNCHPAD_CONTROL,
ROCKET_ANIMATION_CONTROL,
TRIGGER,
DROPPED_LOOT,
RACING_CONTROL,
@ -84,7 +84,7 @@ enum class eReplicaComponentType : uint32_t {
SOUND_TRIGGER,
PROXIMITY_MONITOR,
RACING_SOUND_TRIGGER,
CHAT,
CHAT_BUBBLE,
FRIENDS_LIST,
GUILD,
LOCAL_SYSTEM,
@ -101,12 +101,12 @@ enum class eReplicaComponentType : uint32_t {
TRADE,
USER_CONTROL,
IGNORE_LIST,
ROCKET_LAUNCH_LUP,
BUFF_REAL, // the real buff component, should just be name BUFF
MULTI_ZONE_ENTRANCE,
BUFF,
INTERACTION_MANAGER,
DONATION_VENDOR,
COMBAT_MEDIATOR,
COMMENDATION_VENDOR,
ACHIEVEMENT_VENDOR,
GATE_RUSH_CONTROL,
RAIL_ACTIVATOR,
ROLLER,
@ -121,8 +121,7 @@ enum class eReplicaComponentType : uint32_t {
BUILD_BORDER,
UNKNOWN_115,
CULLING_PLANE,
NUMBER_OF_COMPONENTS,
DESTROYABLE = 1000 // Actually 7
NUMBER_OF_COMPONENTS
};
#endif //!__EREPLICACOMPONENTTYPE__H__

View File

@ -30,7 +30,7 @@
#include "Component.h"
#include "ControllablePhysicsComponent.h"
#include "RenderComponent.h"
#include "RocketLaunchLupComponent.h"
#include "MultiZoneEntranceComponent.h"
#include "CharacterComponent.h"
#include "DestroyableComponent.h"
#include "BuffComponent.h"
@ -58,10 +58,10 @@
#include "PropertyVendorComponent.h"
#include "ProximityMonitorComponent.h"
#include "PropertyEntranceComponent.h"
#include "ModelComponent.h"
#include "ModelBehaviorComponent.h"
#include "ZCompression.h"
#include "PetComponent.h"
#include "VehiclePhysicsComponent.h"
#include "HavokVehiclePhysicsComponent.h"
#include "PossessableComponent.h"
#include "PossessorComponent.h"
#include "ModuleAssemblyComponent.h"
@ -148,21 +148,21 @@ void Entity::Initialize() {
break;
case eReplicaComponentType::BOUNCER:
break;
case eReplicaComponentType::BUFF:
case eReplicaComponentType::DESTROYABLE:
break;
case eReplicaComponentType::GHOST:
break;
case eReplicaComponentType::SKILL:
break;
case eReplicaComponentType::SPAWNER:
case eReplicaComponentType::SPAWN:
break;
case eReplicaComponentType::ITEM:
break;
case eReplicaComponentType::REBUILD:
case eReplicaComponentType::MODULAR_BUILD:
break;
case eReplicaComponentType::REBUILD_START:
case eReplicaComponentType::BUILD_CONTROLLER:
break;
case eReplicaComponentType::REBUILD_ACTIVATOR:
case eReplicaComponentType::BUILD_ACTIVATOR:
break;
case eReplicaComponentType::ICON_ONLY:
break;
@ -192,9 +192,9 @@ void Entity::Initialize() {
break;
case eReplicaComponentType::MODULE:
break;
case eReplicaComponentType::ARCADE:
case eReplicaComponentType::JETPACKPAD:
break;
case eReplicaComponentType::VEHICLE_PHYSICS:
case eReplicaComponentType::HAVOK_VEHICLE_PHYSICS:
break;
case eReplicaComponentType::MOVEMENT_AI:
break;
@ -218,7 +218,7 @@ void Entity::Initialize() {
break;
case eReplicaComponentType::SPRINGPAD:
break;
case eReplicaComponentType::MODEL:
case eReplicaComponentType::MODEL_BEHAVIOR:
break;
case eReplicaComponentType::PROPERTY_ENTRANCE:
break;
@ -226,7 +226,7 @@ void Entity::Initialize() {
break;
case eReplicaComponentType::PROPERTY_MANAGEMENT:
break;
case eReplicaComponentType::VEHICLE_PHYSICS_NEW:
case eReplicaComponentType::VEHICLE_PHYSICS:
break;
case eReplicaComponentType::PHYSICS_SYSTEM:
break;
@ -234,9 +234,9 @@ void Entity::Initialize() {
break;
case eReplicaComponentType::SWITCH:
break;
case eReplicaComponentType::ZONE_CONTROL:
case eReplicaComponentType::MINIGAME_CONTROL:
break;
case eReplicaComponentType::CHANGLING:
case eReplicaComponentType::CHANGLING_BUILD:
break;
case eReplicaComponentType::CHOICE_BUILD:
break;
@ -250,7 +250,7 @@ void Entity::Initialize() {
break;
case eReplicaComponentType::PRECONDITION:
break;
case eReplicaComponentType::PLAYER_FLAG:
case eReplicaComponentType::FLAG:
break;
case eReplicaComponentType::CUSTOM_BUILD_ASSEMBLY:
break;
@ -268,9 +268,9 @@ void Entity::Initialize() {
break;
case eReplicaComponentType::HF_LIGHT_DIRECTION_GADGET:
break;
case eReplicaComponentType::ROCKET_LAUNCH:
case eReplicaComponentType::ROCKET_LAUNCHPAD_CONTROL:
break;
case eReplicaComponentType::ROCKET_LANDING:
case eReplicaComponentType::ROCKET_ANIMATION_CONTROL:
break;
case eReplicaComponentType::TRIGGER:
break;
@ -294,7 +294,7 @@ void Entity::Initialize() {
break;
case eReplicaComponentType::RACING_SOUND_TRIGGER:
break;
case eReplicaComponentType::CHAT:
case eReplicaComponentType::CHAT_BUBBLE:
break;
case eReplicaComponentType::FRIENDS_LIST:
break;
@ -328,9 +328,9 @@ void Entity::Initialize() {
break;
case eReplicaComponentType::IGNORE_LIST:
break;
case eReplicaComponentType::ROCKET_LAUNCH_LUP:
case eReplicaComponentType::MULTI_ZONE_ENTRANCE:
break;
case eReplicaComponentType::BUFF_REAL:
case eReplicaComponentType::BUFF:
break;
case eReplicaComponentType::INTERACTION_MANAGER:
break;
@ -338,7 +338,7 @@ void Entity::Initialize() {
break;
case eReplicaComponentType::COMBAT_MEDIATOR:
break;
case eReplicaComponentType::COMMENDATION_VENDOR:
case eReplicaComponentType::ACHIEVEMENT_VENDOR:
break;
case eReplicaComponentType::GATE_RUSH_CONTROL:
break;
@ -370,8 +370,6 @@ void Entity::Initialize() {
break;
case eReplicaComponentType::NUMBER_OF_COMPONENTS:
break;
case eReplicaComponentType::DESTROYABLE:
break;
case eReplicaComponentType::INVALID:
default:
Game::logger->Log("Entity", "blah %i %i", componentId, m_TemplateID);
@ -483,7 +481,7 @@ void Entity::WriteBaseReplicaData(RakNet::BitStream* outBitStream, eReplicaPacke
const auto& syncLDF = GetVar<std::vector<std::u16string>>(u"syncLDF");
// Only sync for models.
if (m_Settings.size() > 0 && (GetComponent<ModelComponent>() && !GetComponent<PetComponent>())) {
if (m_Settings.size() > 0 && (GetComponent<ModelBehaviorComponent>() && !GetComponent<PetComponent>())) {
outBitStream->Write1(); //ldf data
RakNet::BitStream settingStream;
@ -1216,7 +1214,7 @@ const NiPoint3& Entity::GetPosition() const {
return simple->GetPosition();
}
auto vehicle = GetComponent<VehiclePhysicsComponent>();
auto vehicle = GetComponent<HavokVehiclePhysicsComponent>();
if (vehicle != nullptr) {
return vehicle->GetPosition();
@ -1244,7 +1242,7 @@ const NiQuaternion& Entity::GetRotation() const {
return simple->GetRotation();
}
auto vehicle = GetComponent<VehiclePhysicsComponent>();
auto vehicle = GetComponent<HavokVehiclePhysicsComponent>();
if (vehicle != nullptr) {
return vehicle->GetRotation();
@ -1272,7 +1270,7 @@ void Entity::SetPosition(NiPoint3 position) {
simple->SetPosition(position);
}
auto vehicle = GetComponent<VehiclePhysicsComponent>();
auto vehicle = GetComponent<HavokVehiclePhysicsComponent>();
if (vehicle != nullptr) {
vehicle->SetPosition(position);
@ -1300,7 +1298,7 @@ void Entity::SetRotation(NiQuaternion rotation) {
simple->SetRotation(rotation);
}
auto vehicle = GetComponent<VehiclePhysicsComponent>();
auto vehicle = GetComponent<HavokVehiclePhysicsComponent>();
if (vehicle != nullptr) {
vehicle->SetRotation(rotation);

View File

@ -11,7 +11,7 @@ set(DGAME_DCOMPONENTS_SOURCES "BaseCombatAIComponent.cpp"
"LUPExhibitComponent.cpp"
"MissionComponent.cpp"
"MissionOfferComponent.cpp"
"ModelComponent.cpp"
"ModelBehaviorComponent.cpp"
"ModuleAssemblyComponent.cpp"
"MovementAIComponent.cpp"
"MovingPlatformComponent.cpp"
@ -30,7 +30,7 @@ set(DGAME_DCOMPONENTS_SOURCES "BaseCombatAIComponent.cpp"
"RebuildComponent.cpp"
"RenderComponent.cpp"
"RigidbodyPhantomPhysicsComponent.cpp"
"RocketLaunchLupComponent.cpp"
"MultiZoneEntranceComponent.cpp"
"RocketLaunchpadControlComponent.cpp"
"ScriptedActivityComponent.cpp"
"ShootingGalleryComponent.cpp"
@ -39,5 +39,5 @@ set(DGAME_DCOMPONENTS_SOURCES "BaseCombatAIComponent.cpp"
"SoundTriggerComponent.cpp"
"SwitchComponent.cpp"
"TriggerComponent.cpp"
"VehiclePhysicsComponent.cpp"
"HavokVehiclePhysicsComponent.cpp"
"VendorComponent.cpp" PARENT_SCOPE)

View File

@ -10,7 +10,6 @@
#include "InventoryComponent.h"
#include "ControllablePhysicsComponent.h"
#include "EntityManager.h"
#include "VehiclePhysicsComponent.h"
#include "GameMessages.h"
#include "Item.h"
#include "Amf3.h"

View File

@ -0,0 +1,148 @@
Legend
```
├── Explicit inheritance
├~~ Loaded with Parent
├-> SubComponent
├-? idk lol, but related
```
```tree
LWOActivityComponent
├── LWOShootingGalleryComponent
├── LWOScriptedActivityComponent
└── LWOBaseRacingControlComponent
├── LWORacingControlComponent
└── LWOGateRushControlComponent
├── LWOQuickBuildComponent
├── LWOMiniGameControlComponent
LWOBaseCombatAIComponent
├~~ LWOPathfindingControlComponent
├~~ LWOProximityMonitorComponent
LWOBasePhysComponent
├── LWORigidBodyPhantomComponent
├── LWOPhantomPhysComponent
├── LWOVehiclePhysicsComponent
├── LWOSimplePhysComponent
├── LWOPhysicsSystemComponent
├── LWOHavokVehiclePhysicsComponent
├── LWOControllablePhysComponent
LWOBaseRenderComponent
├── LWOSkinnedRenderComponent
LWOBaseVendorComponent
├── LWOVendorComponent
├~~ LWOProximityMonitorComponent
├── LWODonationVendorComponent
├~~ LWOProximityMonitorComponent
├── LWOAchievementVendorComponent
├~~ LWOProximityMonitorComponent
LWOBBBComponent_Common
├── LWOBBBComponent_Client
LWOBlueprintComponent
LWOBouncerComponent
LWOBuildControllerComponentCommon
├── LWOBuildControllerComponent
LWOChangelingBuildComponent
LWOCharacterComponent
├── LWOMinifigComponent
├~~ LWOPossessionControlComponent
├~~ LWOMountControlComponent
├~~ LWOPetCreatorComponent
├~~ LWOLevelProgressionComponent
├~~ LWOPlayerForcedMovementComponent
├~? LWOPathfindingControlComponent
LWOChestComponent
LWOChoiceBuildComponent
LWOCollectibleComponent
LWOCustomBuildAssemblyComponent
LWODestroyableComponent
├~~ LWOBuffComponent
├~~ LWOStatusEffectComponent
LWODropEffectComponent
LWODroppedLootComponent
LWOExhibitComponent
LWOFXComponent
LWOGenericActivatorComponent
LWOGhostComponent
LWOHFLightDirectionGadgetComponent
LWOInventoryComponent_Common
├── LWOInventoryComponent_Client
└── LWOInventoryComponent_EquippedItem
LWOItemComponent
LWOLUPExhibitComponent
LWOMissionOfferComponent
LWOModelBehaviorComponent
├~~ LWOSimplePhysComponent
├~~ LWOControllablePhysComponent
├~~ LWOPathfindingControlComponent
├~~ LWOMutableModelBehaviorComponent
LWOModelBuilderComponent
LWOModularBuildComponentCommon
├── LWOModularBuildComponent
LWOModuleAssemblyComponent
├── LWOModuleAssemblyComponentCommon
LWOModuleComponentCommon
├── LWOModuleComponent
LWOMovementAIComponent
LWOMultiZoneEntranceComponent
LWOOverheadIconComponent
LWOPetComponent
├~~ LWOPathfindingControlComponent
├~? LWOItemComponent
├~? LWOModelBehaviorComponent
├~~ ...
LWOPlatformBoundaryComponent
LWOPlatformComponent
├-> LWOMoverPlatformSubComponent
├-> LWOSimpleMoverPlatformSubComponent
├-> LWORotaterPlatformSubComponent
LWOProjectilePhysComponent
LWOPropertyComponent
LWOPropertyEntranceComponent
LWOPropertyManagementComponent
LWOPropertyVendorComponent
LWOProximityMonitorComponent
LWOSoundTriggerComponent
├── LWORacingSoundTriggerComponent
LWORacingStatsComponentCommon
├── LWORacingStatsComponent
LWORocketAnimationControlComponentCommon
├── LWORocketAnimationControlComponent
LWORocketLaunchpadControlComponentCommon
├── LWORocketLaunchpadControlComponent
LWOScriptComponent
├~~ LWOPathfindingControlComponent
├~~ LWOProximityMonitorComponent
LWOShowcaseModelHandlerComponent
LWOSkillComponent
LWOSoundAmbient2DComponent
LWOSoundAmbient3DComponent
LWOSoundRepeaterComponent
LWOSpawnComponent
LWOSpringpadComponent
LWOSwitchComponent
LWOTriggerComponent
LocalPlayer (not a component)
├~~ LWOInteractionManagerComponent
├~~ LWOUserControlComponent
├~~ LWOFriendsListComponent
├~~ LWOIgnoreListComponent
├~~ LWOTextEffectComponent
├~~ LWOChatBubbleComponent
├~~ LWOGuildComponent
├~~ LWOPlayerPetTamingComponent
├~~ LWOLocalSystemsComponent
├~~ LWOSlashCommandComponent
├~~ LWOMissionComponent
├~~ LWOPropertyEditorComponent
├~~ LWOComponent115
├~~ LWOTeamsComponent
├~~ LWOChatComponent
├~~ LWOPetControlComponent
├~~ LWOTradeComponent
├~~ LWOPreconditionComponent
├~~ LWOFlagComponent
├~~ LWOFactionTriggerComponent
```

View File

@ -1,7 +1,7 @@
#include "VehiclePhysicsComponent.h"
#include "HavokVehiclePhysicsComponent.h"
#include "EntityManager.h"
VehiclePhysicsComponent::VehiclePhysicsComponent(Entity* parent) : Component(parent) {
HavokVehiclePhysicsComponent::HavokVehiclePhysicsComponent(Entity* parent) : Component(parent) {
m_Position = NiPoint3::ZERO;
m_Rotation = NiQuaternion::IDENTITY;
m_Velocity = NiPoint3::ZERO;
@ -14,52 +14,52 @@ VehiclePhysicsComponent::VehiclePhysicsComponent(Entity* parent) : Component(par
m_EndBehavior = GeneralUtils::GenerateRandomNumber<uint32_t>(0, 7);
}
VehiclePhysicsComponent::~VehiclePhysicsComponent() {
HavokVehiclePhysicsComponent::~HavokVehiclePhysicsComponent() {
}
void VehiclePhysicsComponent::SetPosition(const NiPoint3& pos) {
void HavokVehiclePhysicsComponent::SetPosition(const NiPoint3& pos) {
m_Position = pos;
}
void VehiclePhysicsComponent::SetRotation(const NiQuaternion& rot) {
void HavokVehiclePhysicsComponent::SetRotation(const NiQuaternion& rot) {
m_DirtyPosition = true;
m_Rotation = rot;
}
void VehiclePhysicsComponent::SetVelocity(const NiPoint3& vel) {
void HavokVehiclePhysicsComponent::SetVelocity(const NiPoint3& vel) {
m_DirtyPosition = true;
m_Velocity = vel;
}
void VehiclePhysicsComponent::SetAngularVelocity(const NiPoint3& vel) {
void HavokVehiclePhysicsComponent::SetAngularVelocity(const NiPoint3& vel) {
m_DirtyPosition = true;
m_AngularVelocity = vel;
}
void VehiclePhysicsComponent::SetIsOnGround(bool val) {
void HavokVehiclePhysicsComponent::SetIsOnGround(bool val) {
m_DirtyPosition = true;
m_IsOnGround = val;
}
void VehiclePhysicsComponent::SetIsOnRail(bool val) {
void HavokVehiclePhysicsComponent::SetIsOnRail(bool val) {
m_DirtyPosition = true;
m_IsOnRail = val;
}
void VehiclePhysicsComponent::SetDirtyPosition(bool val) {
void HavokVehiclePhysicsComponent::SetDirtyPosition(bool val) {
m_DirtyPosition = val;
}
void VehiclePhysicsComponent::SetDirtyVelocity(bool val) {
void HavokVehiclePhysicsComponent::SetDirtyVelocity(bool val) {
m_DirtyVelocity = val;
}
void VehiclePhysicsComponent::SetDirtyAngularVelocity(bool val) {
void HavokVehiclePhysicsComponent::SetDirtyAngularVelocity(bool val) {
m_DirtyAngularVelocity = val;
}
void VehiclePhysicsComponent::Serialize(RakNet::BitStream* outBitStream, bool bIsInitialUpdate, unsigned int& flags) {
void HavokVehiclePhysicsComponent::Serialize(RakNet::BitStream* outBitStream, bool bIsInitialUpdate, unsigned int& flags) {
outBitStream->Write(bIsInitialUpdate || m_DirtyPosition);
if (bIsInitialUpdate || m_DirtyPosition) {
@ -101,7 +101,7 @@ void VehiclePhysicsComponent::Serialize(RakNet::BitStream* outBitStream, bool bI
outBitStream->Write0();
}
void VehiclePhysicsComponent::Update(float deltaTime) {
void HavokVehiclePhysicsComponent::Update(float deltaTime) {
if (m_SoftUpdate > 5) {
EntityManager::Instance()->SerializeEntity(m_OwningEntity);

View File

@ -8,12 +8,12 @@
/**
* Physics component for vehicles.
*/
class VehiclePhysicsComponent : public Component {
class HavokVehiclePhysicsComponent : public Component {
public:
static const eReplicaComponentType ComponentType = eReplicaComponentType::VEHICLE_PHYSICS;
static const eReplicaComponentType ComponentType = eReplicaComponentType::HAVOK_VEHICLE_PHYSICS;
VehiclePhysicsComponent(Entity* parentEntity);
~VehiclePhysicsComponent() override;
HavokVehiclePhysicsComponent(Entity* parentEntity);
~HavokVehiclePhysicsComponent() override;
void Serialize(RakNet::BitStream* outBitStream, bool bIsInitialUpdate, unsigned int& flags);

View File

@ -19,7 +19,7 @@
#include "PossessorComponent.h"
#include "PossessableComponent.h"
#include "ModuleAssemblyComponent.h"
#include "VehiclePhysicsComponent.h"
#include "HavokVehiclePhysicsComponent.h"
#include "CharacterComponent.h"
#include "dZoneManager.h"
#include "PropertyManagementComponent.h"
@ -826,7 +826,7 @@ void InventoryComponent::EquipItem(Item* item, const bool skipChecks) {
if (character != nullptr && !skipChecks) {
// Hacky proximity rocket
if (item->GetLot() == 6416) {
const auto rocketLauchPads = EntityManager::Instance()->GetEntitiesByComponent(eReplicaComponentType::ROCKET_LAUNCH);
const auto rocketLauchPads = EntityManager::Instance()->GetEntitiesByComponent(eReplicaComponentType::ROCKET_LAUNCHPAD_CONTROL);
const auto position = m_OwningEntity->GetPosition();
@ -986,8 +986,8 @@ void InventoryComponent::HandlePossession(Item* item) {
auto* mount = EntityManager::Instance()->CreateEntity(info, nullptr, m_OwningEntity);
// Check to see if the mount is a vehicle, if so, flip it
auto vehicleComponent = mount->GetComponent<VehiclePhysicsComponent>();
if (vehicleComponent) {
auto havokVehiclePhysicsComponent = mount->GetComponent<HavokVehiclePhysicsComponent>();
if (havokVehiclePhysicsComponent) {
auto angles = startRotation.GetEulerAngles();
// Make it right side up
angles.x -= PI;
@ -1024,7 +1024,7 @@ void InventoryComponent::HandlePossession(Item* item) {
EntityManager::Instance()->SerializeEntity(m_OwningEntity);
// have to unlock the input so it vehicle can be driven
if (vehicleComponent) GameMessages::SendVehicleUnlockInput(mount->GetObjectID(), false, m_OwningEntity->GetSystemAddress());
if (havokVehiclePhysicsComponent) GameMessages::SendVehicleUnlockInput(mount->GetObjectID(), false, m_OwningEntity->GetSystemAddress());
GameMessages::SendMarkInventoryItemAsActive(m_OwningEntity->GetObjectID(), true, eUnequippableActiveType::MOUNT, item->GetId(), m_OwningEntity->GetSystemAddress());
}

View File

@ -1,14 +1,14 @@
#include "ModelComponent.h"
#include "ModelBehaviorComponent.h"
#include "Entity.h"
ModelComponent::ModelComponent(Entity* parent) : Component(parent) {
ModelBehaviorComponent::ModelBehaviorComponent(Entity* parent) : Component(parent) {
m_OriginalPosition = m_OwningEntity->GetDefaultPosition();
m_OriginalRotation = m_OwningEntity->GetDefaultRotation();
m_userModelID = m_OwningEntity->GetVarAs<LWOOBJID>(u"userModelID");
}
void ModelComponent::Serialize(RakNet::BitStream* outBitStream, bool bIsInitialUpdate, unsigned int& flags) {
void ModelBehaviorComponent::Serialize(RakNet::BitStream* outBitStream, bool bIsInitialUpdate, unsigned int& flags) {
// ItemComponent Serialization. Pets do not get this serialization.
if (!m_OwningEntity->HasComponent(eReplicaComponentType::PET)) {
outBitStream->Write1();

View File

@ -11,11 +11,11 @@ class Entity;
/**
* Component that represents entities that are a model, e.g. collectible models and BBB models.
*/
class ModelComponent : public Component {
class ModelBehaviorComponent : public Component {
public:
static const eReplicaComponentType ComponentType = eReplicaComponentType::MODEL;
static const eReplicaComponentType ComponentType = eReplicaComponentType::MODEL_BEHAVIOR;
ModelComponent(Entity* parent);
ModelBehaviorComponent(Entity* parent);
void Serialize(RakNet::BitStream* outBitStream, bool bIsInitialUpdate, unsigned int& flags);

View File

@ -1,9 +1,9 @@
#include "RocketLaunchLupComponent.h"
#include "MultiZoneEntranceComponent.h"
#include "RocketLaunchpadControlComponent.h"
#include "InventoryComponent.h"
#include "CharacterComponent.h"
RocketLaunchLupComponent::RocketLaunchLupComponent(Entity* parent) : Component(parent) {
MultiZoneEntranceComponent::MultiZoneEntranceComponent(Entity* parent) : Component(parent) {
m_OwningEntity = parent;
std::string zoneString = GeneralUtils::UTF16ToWTF8(m_OwningEntity->GetVar<std::u16string>(u"MultiZoneIDs"));
std::stringstream ss(zoneString);
@ -14,9 +14,9 @@ RocketLaunchLupComponent::RocketLaunchLupComponent(Entity* parent) : Component(p
}
}
RocketLaunchLupComponent::~RocketLaunchLupComponent() {}
MultiZoneEntranceComponent::~MultiZoneEntranceComponent() {}
void RocketLaunchLupComponent::OnUse(Entity* originator) {
void MultiZoneEntranceComponent::OnUse(Entity* originator) {
auto rocket = originator->GetComponent<CharacterComponent>()->RocketEquip(originator);
if (!rocket) return;
@ -24,7 +24,7 @@ void RocketLaunchLupComponent::OnUse(Entity* originator) {
GameMessages::SendPropertyEntranceBegin(m_OwningEntity->GetObjectID(), m_OwningEntity->GetSystemAddress());
}
void RocketLaunchLupComponent::OnSelectWorld(Entity* originator, uint32_t index) {
void MultiZoneEntranceComponent::OnSelectWorld(Entity* originator, uint32_t index) {
auto rocketLaunchpadControlComponent = m_OwningEntity->GetComponent<RocketLaunchpadControlComponent>();
if (!rocketLaunchpadControlComponent) return;

View File

@ -9,16 +9,16 @@
* Component that handles the LUP/WBL rocket launchpad that can be interacted with to travel to WBL worlds.
*
*/
class RocketLaunchLupComponent : public Component {
class MultiZoneEntranceComponent : public Component {
public:
static const eReplicaComponentType ComponentType = eReplicaComponentType::ROCKET_LAUNCH_LUP;
static const eReplicaComponentType ComponentType = eReplicaComponentType::MULTI_ZONE_ENTRANCE;
/**
* Constructor for this component, builds the m_LUPWorlds vector
* @param parent parent that contains this component
*/
RocketLaunchLupComponent(Entity* parent);
~RocketLaunchLupComponent() override;
MultiZoneEntranceComponent(Entity* parent);
~MultiZoneEntranceComponent() override;
/**
* Handles an OnUse event from some entity, preparing it for launch to some other world

View File

@ -17,7 +17,6 @@
#include "PossessorComponent.h"
#include "eRacingTaskParam.h"
#include "Spawner.h"
#include "VehiclePhysicsComponent.h"
#include "dServer.h"
#include "dZoneManager.h"
#include "dConfig.h"

View File

@ -13,7 +13,7 @@
#include "ChatPackets.h"
#include "MissionComponent.h"
#include "PropertyEntranceComponent.h"
#include "RocketLaunchLupComponent.h"
#include "MultiZoneEntranceComponent.h"
#include "dServer.h"
#include "PacketUtils.h"
#include "eObjectWorldState.h"
@ -94,8 +94,8 @@ void RocketLaunchpadControlComponent::OnUse(Entity* originator) {
return;
}
auto rocketLaunchLUP = m_OwningEntity->GetComponent<RocketLaunchLupComponent>();
if (rocketLaunchLUP) {
auto multiZoneEntranceComponent = m_OwningEntity->GetComponent<MultiZoneEntranceComponent>();
if (multiZoneEntranceComponent) {
return;
}

View File

@ -18,7 +18,7 @@ class PreconditionExpression;
*/
class RocketLaunchpadControlComponent : public Component {
public:
static const eReplicaComponentType ComponentType = eReplicaComponentType::ROCKET_LAUNCH;
static const eReplicaComponentType ComponentType = eReplicaComponentType::ROCKET_LAUNCHPAD_CONTROL;
RocketLaunchpadControlComponent(Entity* parent, int rocketId);
~RocketLaunchpadControlComponent() override;

View File

@ -24,7 +24,7 @@
#include "dConfig.h"
#include "TeamManager.h"
#include "ChatPackets.h"
#include "RocketLaunchLupComponent.h"
#include "MultiZoneEntranceComponent.h"
#include "eUnequippableActiveType.h"
#include "eMovementPlatformState.h"
#include "LeaderboardManager.h"
@ -69,7 +69,6 @@
#include "MovingPlatformComponent.h"
#include "PetComponent.h"
#include "ModuleAssemblyComponent.h"
#include "VehiclePhysicsComponent.h"
#include "RenderComponent.h"
#include "PossessableComponent.h"
#include "PossessorComponent.h"
@ -2809,9 +2808,9 @@ void GameMessages::HandleEnterProperty(RakNet::BitStream* inStream, Entity* enti
return;
}
auto rocketLaunchLupComponent = entity->GetComponent<RocketLaunchLupComponent>();
if (rocketLaunchLupComponent != nullptr) {
rocketLaunchLupComponent->OnSelectWorld(player, index);
auto multiZoneEntranceComponent = entity->GetComponent<MultiZoneEntranceComponent>();
if (multiZoneEntranceComponent != nullptr) {
multiZoneEntranceComponent->OnSelectWorld(player, index);
}
}

View File

@ -4,7 +4,7 @@
#include "Entity.h"
#include "Game.h"
#include "GameMessages.h"
#include "ModelComponent.h"
#include "ModelBehaviorComponent.h"
#include "../../dWorldServer/ObjectIDManager.h"
#include "dLogger.h"
#include "BehaviorStates.h"
@ -30,7 +30,7 @@
#include "UpdateActionMessage.h"
#include "UpdateStripUiMessage.h"
void ControlBehaviors::RequestUpdatedID(int32_t behaviorID, std::shared_ptr<ModelComponent> modelComponent, Entity* modelOwner, const SystemAddress& sysAddr) {
void ControlBehaviors::RequestUpdatedID(int32_t behaviorID, std::shared_ptr<ModelBehaviorComponent> modelComponent, Entity* modelOwner, const SystemAddress& sysAddr) {
// auto behavior = modelComponent->FindBehavior(behaviorID);
// if (behavior->GetBehaviorID() == -1 || behavior->GetShouldSetNewID()) {
// ObjectIDManager::Instance()->RequestPersistentID(
@ -57,7 +57,7 @@ void ControlBehaviors::RequestUpdatedID(int32_t behaviorID, std::shared_ptr<Mode
}
void ControlBehaviors::SendBehaviorListToClient(Entity* modelEntity, const SystemAddress& sysAddr, Entity* modelOwner) {
auto modelComponent = modelEntity->GetComponent<ModelComponent>();
auto modelComponent = modelEntity->GetComponent<ModelBehaviorComponent>();
if (!modelComponent) return;
@ -79,7 +79,7 @@ void ControlBehaviors::SendBehaviorListToClient(Entity* modelEntity, const Syste
GameMessages::SendUIMessageServerToSingleClient(modelOwner, sysAddr, "UpdateBehaviorList", behaviorsToSerialize);
}
void ControlBehaviors::ModelTypeChanged(AMFArrayValue* arguments, std::shared_ptr<ModelComponent> ModelComponent) {
void ControlBehaviors::ModelTypeChanged(AMFArrayValue* arguments, std::shared_ptr<ModelBehaviorComponent> ModelBehaviorComponent) {
auto* modelTypeAmf = arguments->Get<double>("ModelType");
if (!modelTypeAmf) return;
@ -137,7 +137,7 @@ void ControlBehaviors::Rename(Entity* modelEntity, const SystemAddress& sysAddr,
}
// TODO This is also supposed to serialize the state of the behaviors in progress but those aren't implemented yet
void ControlBehaviors::SendBehaviorBlocksToClient(std::shared_ptr<ModelComponent> modelComponent, const SystemAddress& sysAddr, Entity* modelOwner, AMFArrayValue* arguments) {
void ControlBehaviors::SendBehaviorBlocksToClient(std::shared_ptr<ModelBehaviorComponent> modelComponent, const SystemAddress& sysAddr, Entity* modelOwner, AMFArrayValue* arguments) {
// uint32_t behaviorID = ControlBehaviors::GetBehaviorIDFromArgument(arguments);
// auto modelBehavior = modelComponent->FindBehavior(behaviorID);
@ -266,7 +266,7 @@ void ControlBehaviors::UpdateAction(AMFArrayValue* arguments) {
}
}
void ControlBehaviors::MoveToInventory(std::shared_ptr<ModelComponent> modelComponent, const SystemAddress& sysAddr, Entity* modelOwner, AMFArrayValue* arguments) {
void ControlBehaviors::MoveToInventory(std::shared_ptr<ModelBehaviorComponent> modelComponent, const SystemAddress& sysAddr, Entity* modelOwner, AMFArrayValue* arguments) {
// This closes the UI menu should it be open while the player is removing behaviors
AMFArrayValue args;
@ -281,7 +281,7 @@ void ControlBehaviors::MoveToInventory(std::shared_ptr<ModelComponent> modelComp
void ControlBehaviors::ProcessCommand(Entity* modelEntity, const SystemAddress& sysAddr, AMFArrayValue* arguments, std::string command, Entity* modelOwner) {
if (!isInitialized || !modelEntity || !modelOwner || !arguments) return;
auto modelComponent = modelEntity->GetComponent<ModelComponent>();
auto modelComponent = modelEntity->GetComponent<ModelBehaviorComponent>();
if (!modelComponent) return;

View File

@ -11,7 +11,7 @@
class AMFArrayValue;
class BlockDefinition;
class Entity;
class ModelComponent;
class ModelBehaviorComponent;
class SystemAddress;
// Type definition to clarify what is used where
@ -41,9 +41,9 @@ public:
*/
BlockDefinition* GetBlockInfo(const BlockName& blockName);
private:
void RequestUpdatedID(int32_t behaviorID, std::shared_ptr<ModelComponent> modelComponent, Entity* modelOwner, const SystemAddress& sysAddr);
void RequestUpdatedID(int32_t behaviorID, std::shared_ptr<ModelBehaviorComponent> modelComponent, Entity* modelOwner, const SystemAddress& sysAddr);
void SendBehaviorListToClient(Entity* modelEntity, const SystemAddress& sysAddr, Entity* modelOwner);
void ModelTypeChanged(AMFArrayValue* arguments, std::shared_ptr<ModelComponent> ModelComponent);
void ModelTypeChanged(AMFArrayValue* arguments, std::shared_ptr<ModelBehaviorComponent> ModelBehaviorComponent);
void ToggleExecutionUpdates();
void AddStrip(AMFArrayValue* arguments);
void RemoveStrip(AMFArrayValue* arguments);
@ -56,9 +56,9 @@ private:
void Add(AMFArrayValue* arguments);
void RemoveActions(AMFArrayValue* arguments);
void Rename(Entity* modelEntity, const SystemAddress& sysAddr, Entity* modelOwner, AMFArrayValue* arguments);
void SendBehaviorBlocksToClient(std::shared_ptr<ModelComponent> modelComponent, const SystemAddress& sysAddr, Entity* modelOwner, AMFArrayValue* arguments);
void SendBehaviorBlocksToClient(std::shared_ptr<ModelBehaviorComponent> modelComponent, const SystemAddress& sysAddr, Entity* modelOwner, AMFArrayValue* arguments);
void UpdateAction(AMFArrayValue* arguments);
void MoveToInventory(std::shared_ptr<ModelComponent> modelComponent, const SystemAddress& sysAddr, Entity* modelOwner, AMFArrayValue* arguments);
void MoveToInventory(std::shared_ptr<ModelBehaviorComponent> modelComponent, const SystemAddress& sysAddr, Entity* modelOwner, AMFArrayValue* arguments);
std::map<BlockName, BlockDefinition*> blockTypes{};
// If false, property behaviors will not be able to be edited.

View File

@ -59,7 +59,7 @@
#include "dpShapeSphere.h"
#include "PossessableComponent.h"
#include "PossessorComponent.h"
#include "VehiclePhysicsComponent.h"
#include "HavokVehiclePhysicsComponent.h"
#include "BuffComponent.h"
#include "SkillComponent.h"
#include "VanityUtilities.h"
@ -940,9 +940,9 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
auto* possassableEntity = EntityManager::Instance()->GetEntity(possessorComponent->GetPossessable());
if (possassableEntity != nullptr) {
auto vehiclePhysicsComponent = possassableEntity->GetComponent<VehiclePhysicsComponent>();
if (vehiclePhysicsComponent) {
vehiclePhysicsComponent->SetPosition(pos);
auto havokVehiclePhysicsComponent = possassableEntity->GetComponent<HavokVehiclePhysicsComponent>();
if (havokVehiclePhysicsComponent) {
havokVehiclePhysicsComponent->SetPosition(pos);
EntityManager::Instance()->SerializeEntity(possassableEntity);
} else GameMessages::SendTeleport(possassableEntity->GetObjectID(), pos, NiQuaternion(), sysAddr);
}
@ -1267,8 +1267,8 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
return;
}
auto vehiclePhysicsComponent = newEntity->GetComponent<VehiclePhysicsComponent>();
if (vehiclePhysicsComponent) {
auto havokVehiclePhysicsComponent = newEntity->GetComponent<HavokVehiclePhysicsComponent>();
if (havokVehiclePhysicsComponent) {
auto newRot = newEntity->GetRotation();
auto angles = newRot.GetEulerAngles();
// make it right side up

View File

@ -2,6 +2,7 @@
#include <string>
#include <vector>
#include <cstdint>
class RawChunk;
struct RawMesh;

View File

@ -27,7 +27,7 @@
#include "Zone.h"
#include "PossessorComponent.h"
#include "PossessableComponent.h"
#include "VehiclePhysicsComponent.h"
#include "HavokVehiclePhysicsComponent.h"
#include "dConfig.h"
#include "CharacterComponent.h"
#include "Database.h"
@ -148,19 +148,19 @@ void ClientPackets::HandleClientPositionUpdate(const SystemAddress& sysAddr, Pac
if (possessableComponent->GetPossessionType() != ePossessionType::ATTACHED_VISIBLE) updateChar = false;
}
auto vehiclePhysicsComponent = possassableEntity->GetComponent<VehiclePhysicsComponent>();
if (vehiclePhysicsComponent != nullptr) {
auto havokVehiclePhysicsComponent = possassableEntity->GetComponent<HavokVehiclePhysicsComponent>();
if (havokVehiclePhysicsComponent != nullptr) {
// This is flipped for whatever reason
rotation = NiQuaternion(rotation.z, rotation.y, rotation.x, rotation.w);
vehiclePhysicsComponent->SetPosition(position);
vehiclePhysicsComponent->SetRotation(rotation);
vehiclePhysicsComponent->SetIsOnGround(onGround);
vehiclePhysicsComponent->SetIsOnRail(onRail);
vehiclePhysicsComponent->SetVelocity(velocity);
vehiclePhysicsComponent->SetDirtyVelocity(velocityFlag);
vehiclePhysicsComponent->SetAngularVelocity(angVelocity);
vehiclePhysicsComponent->SetDirtyAngularVelocity(angVelocityFlag);
havokVehiclePhysicsComponent->SetPosition(position);
havokVehiclePhysicsComponent->SetRotation(rotation);
havokVehiclePhysicsComponent->SetIsOnGround(onGround);
havokVehiclePhysicsComponent->SetIsOnRail(onRail);
havokVehiclePhysicsComponent->SetVelocity(velocity);
havokVehiclePhysicsComponent->SetDirtyVelocity(velocityFlag);
havokVehiclePhysicsComponent->SetAngularVelocity(angVelocity);
havokVehiclePhysicsComponent->SetDirtyAngularVelocity(angVelocityFlag);
} else {
// Need to get the mount's controllable physics
auto controllablePhysicsComponent = possassableEntity->GetComponent<ControllablePhysicsComponent>();

View File

@ -3,6 +3,7 @@
#include <string>
#include <vector>
#include <cstdint>
class Command;
class Event;