1234567891011121314151617181920212223242526272829303132333435363738394041 |
- /*
- * Copyright (c) Contributors to the Open 3D Engine Project.
- * For complete copyright and license terms please see the LICENSE at the root of this distribution.
- *
- * SPDX-License-Identifier: Apache-2.0 OR MIT
- *
- */
- #include <Source/SphereColliderComponent.h>
- #include <AzCore/Component/Entity.h>
- #include <AzCore/Serialization/SerializeContext.h>
- #include <AzCore/std/smart_ptr/make_shared.h>
- #include <Source/Utils.h>
- namespace PhysX
- {
- void SphereColliderComponent::Reflect(AZ::ReflectContext* context)
- {
- if (auto serializeContext = azrtti_cast<AZ::SerializeContext*>(context))
- {
- serializeContext->Class<SphereColliderComponent, BaseColliderComponent>()
- ->Version(1)
- ;
- }
- }
- // BaseColliderComponent
- void SphereColliderComponent::UpdateScaleForShapeConfigs()
- {
- if (m_shapeConfigList.size() != 1)
- {
- AZ_Error("PhysX Capsule Collider Component", false,
- "Expected exactly one collider/shape configuration for entity \"%s\".", GetEntity()->GetName().c_str());
- return;
- }
- m_shapeConfigList[0].second->m_scale = AZ::Vector3(Utils::GetTransformScale(GetEntityId()));
- }
- }
|