Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,21 @@ void FAnimNode_KawaiiPhysics::PreUpdate(const UAnimInstance* InAnimInstance)
#endif
}

const FVector& FAnimNode_KawaiiPhysics::GetSkelCompMoveVector() const
{
return this->SkelCompMoveVector;
}

const FQuat& FAnimNode_KawaiiPhysics::GetSkelCompMoveRotation() const
{
return this->SkelCompMoveRotation;
}

float FAnimNode_KawaiiPhysics::GetDeltaTimeOld() const
{
return this->DeltaTimeOld;
}

void FAnimNode_KawaiiPhysics::InitializeBoneReferences(const FBoneContainer& RequiredBones)
{
auto Initialize = [&RequiredBones](auto& Targets)
Expand Down Expand Up @@ -908,6 +923,7 @@ void FAnimNode_KawaiiPhysics::UpdateModifyBonesPoseTransform(FComponentSpacePose
void FAnimNode_KawaiiPhysics::UpdateSkelCompMove(const FTransform& ComponentTransform)
{
SkelCompMoveVector = ComponentTransform.InverseTransformPosition(PreSkelCompTransform.GetLocation());
SkelCompMoveVector = SkelCompMoveVector * SkeletalComponentMoveScale + SkeletalComponentFixedMoveOffset;
if (SkelCompMoveVector.SizeSquared() > TeleportDistanceThreshold * TeleportDistanceThreshold)
{
SkelCompMoveVector = FVector::ZeroVector;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -903,6 +903,24 @@ struct KAWAIIPHYSICS_API FAnimNode_KawaiiPhysics : public FAnimNode_SkeletalCont
meta=(DisplayName="CustomExternalForces(EXPERIMENTAL)"))
TArray<TObjectPtr<UKawaiiPhysics_CustomExternalForce>> CustomExternalForces;

/**
* 移動ベクトルを計算するときに適用するスケルトン コンポーネントの移動スケール。
*
* The skeletal component move scale to apply when calculate the move vector.
*/
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "ExternalForce",
meta = (PinHiddenByDefault))
FVector SkeletalComponentMoveScale = FVector::One();

/**
* 移動ベクトルをスケーリングした後に適用されるボーン コンポーネントの固定移動オフセット。
*
* The fixed skeletal component move offset to apply after the scaled the move vector.
*/
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "ExternalForce",
meta = (PinHiddenByDefault))
FVector SkeletalComponentFixedMoveOffset = FVector::ZeroVector;

/**
* レベル上の各コリジョンとの判定を行うフラグ。有効にすると物理処理の負荷が大幅に上がります
* Flag for collision detection with each collision on the level. Enabling this will significantly increase the load of physics processing.
Expand Down Expand Up @@ -1021,6 +1039,27 @@ struct KAWAIIPHYSICS_API FAnimNode_KawaiiPhysics : public FAnimNode_SkeletalCont
}
#endif

/**
* Gets the vector representing the movement of the skeletal component.
*
* @return The vector representing the movement of the skeletal component.
*/
const FVector& GetSkelCompMoveVector() const;

/**
* Gets the quaternion representing the rotation of the skeletal component.
*
* @return The quaternion representing the rotation of the skeletal component.
*/
const FQuat& GetSkelCompMoveRotation() const;

/**
* Gets the delta time from the previous frame.
*
* @return The delta time from the previous frame.
*/
float GetDeltaTimeOld() const;

protected:
/**
* Gets the forward vector of a bone based on its rotation.
Expand Down