Skip to content

Turret child object - #47

Draft
Ikreb1 wants to merge 14 commits into
mainfrom
turret-child-object
Draft

Turret child object#47
Ikreb1 wants to merge 14 commits into
mainfrom
turret-child-object

Conversation

@Ikreb1

@Ikreb1 Ikreb1 commented Aug 4, 2026

Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings August 4, 2026 14:03

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces an EveChildTurret space-object child implementation and adds supporting animation hooks/APIs to enable turret-specific pose modification and animation stopping behavior, along with a few related fixes and build/config updates.

Changes:

  • Add EveChildTurret (new child type) with firing/tracking state logic, Blue exposure, and cached geometry/animation integration.
  • Add ITr2PoseModifier and integrate it into Tr2GrannyAnimation so external components can modify a sampled CMF pose (e.g., turret tracking bone edits).
  • Add StopAnimations(delay) to animation layers / updater and expose it to Blue; plus minor comment/spelling and formatting/config updates.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
trinity/Tr2GrannyAnimationLayer.h Adds StopAnimations(delay) API to the layer interface.
trinity/Tr2GrannyAnimationLayer.cpp Implements StopAnimations(delay) and ensures finished CMF animations are removed.
trinity/Tr2GrannyAnimation.h Adds pose-modifier plumbing (ITr2PoseModifier*) and StopAnimations(delay) on the updater.
trinity/Tr2GrannyAnimation.cpp Wires StopAnimations to the base layer and calls pose modifier during CMF pose sampling.
trinity/Tr2GrannyAnimation_Blue.cpp Exposes StopAnimations(delay) to Blue.
trinity/Include/ITr2PoseModifier.h New interface for skeletal pose modification.
trinity/Eve/Turret/EveTurretTarget.h Adds SetImpactBehaviour API.
trinity/Eve/Turret/EveTurretTarget.cpp Implements SetImpactBehaviour and reuses it from SetBehaviour.
trinity/Eve/Turret/EveTurretSet.cpp Comment spelling fixes (and minor documentation cleanups).
trinity/Eve/SpaceObject/EveSpaceObject2.cpp Initializes runtime-inserted children that implement IInitialize.
trinity/Eve/SpaceObject/Children/EveChildTurret.h New turret child declaration; implements ITr2PoseModifier.
trinity/Eve/SpaceObject/Children/EveChildTurret.cpp New turret child implementation: state machine, firing FX, tracking pose edits, animation control.
trinity/Eve/SpaceObject/Children/EveChildTurret_Blue.cpp Blue exposure for EveChildTurret API and attributes.
trinity/Eve/SpaceObject/Children/EveChildMesh.h Adds override markers for update methods; makes InitializeAnimation() virtual.
trinity/CMakeLists.txt Adds new source/header files to the build.
.clang-format Sets ObjC ColumnLimit: 0 with rationale comment to avoid unwanted wrapping.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -0,0 +1,19 @@
// Copyright © 2026 Fenris Creations ehf.
Comment on lines +169 to +176
if( int closestLocator = m_target->FindClosestLocator( &source, &position ) )
{
if( closestLocator != m_target->GetLocator() )
{
// Set up the firing states correctly
SetupFiringState();
}
}
Comment thread trinity/Tr2GrannyAnimation.cpp Outdated
GrannyColumnMatrixMultiply4x3Transpose(
(granny_real32*)( (granny_matrix_3x4*)m_boneTransforms.get() )[i],
(granny_real32*)m_meshSkeleton->Bones[meshToBone[i]].InverseWorld4x4,
(granny_real32*)m_meshSkeleton -> Bones[meshToBone[i]].InverseWorld4x4,
MAP_METHOD_AND_WRAP(
"GetFiringBoneWorldTransform",
GetFiringBoneWorldTransform,
"Returns the world transform matrix of the specfified firing bone in the currently firing turret."

// --------------------------------------------------------------------------------
// Description:
// Initialize data members, set everything to inlavid/empty and call

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has been spun out into their own PR and ill be merging it in and this should get removed once you updated latest on main when that other PR is in

Comment thread .clang-format
# Kept at 0 to match the Cpp section: some tools (e.g. CLion's ClangFormat
# integration) misclassify C++ .h files as ObjC and would otherwise re-wrap
# lines at the column limit.
ColumnLimit: 0

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has been spun out into their own PR and ill be merging it in and this should get removed once you updated latest on main when that other PR is in

bool PlayAnimation( const Tr2GrannyAnimation* grannyAnimation, const char* animName, bool replace, int loopCount, float delay, float speed, bool clearWhenDone );
void QueueAnimation( const char* animName, bool replace, int loopCount, float delay, float speed, bool clearWhenDone );
void EndAnimation();
void StopAnimations( float delay );

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

blue optional for the delay is something i wanted to do

}
#endif

void Tr2GrannyAnimationLayer::StopAnimations( float delay )

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is buggy and spins the turret around if there is no animation set, works fine in the turret class as it does stop -> nextanimation

ClearAnimations,
"ClearAnimations()\n\n"
"Abruptly ends all animations." )
MAP_METHOD_AND_WRAP(

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

blue optional for the delay parameter maybe?


if( m_poseModifier )
{
m_poseModifier->ModifyPose( skeleton, m_pose );

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still not super sure what this does, but it was needed from eveturretset which had its own animation handling logic


// hit/miss
void SetBehaviour( bool laserMiss, bool projectileMiss, float impactSize, ImpactBehaviour::Type impactBehaviour );
void SetImpactBehaviour( float impactSize, ImpactBehaviour::Type impactBehaviour );

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

didnt need lasermiss and projectilemiss in evechildturret so split into two functions

@@ -0,0 +1,182 @@
// Copyright © 2026 Fenris Creations ehf.

#pragma once

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mostly a copy of eveturretset but simplified greatly and inherits from evechildmesh

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just needed inheritance logic, simple as

berkeleynerd pushed a commit to berkeleynerd/trinity that referenced this pull request Aug 9, 2026
…ping (carbonengine#47)

Co-authored-by: rebecca <1+rebecca@noreply.localhost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants