mirror of
https://github.com/Facepunch/sbox-public.git
synced 2026-08-01 08:18:20 -04:00
https://sbox.game/dev/doc/gameplay/inventory-weapons/ Added InventoryComponent - a slot based inventory, hotbar or shared bucket slots, with a starting loadout BaseInventoryItem - base class for inventory items, with hooks to veto switching, holstering and dropping BaseWeapon - a GMod style base weapon - fire modes, magazines and reserve ammo, reloading, dry fire, ballistics, spread, crosshair and HUD BaseWeaponModel - view/world model base with muzzle flash, brass ejection, tracers and animation hooks Ammo types are resources (.ammo) - weapons share reserve pools by type, clamped to a max reserve BaseWeapon.ShootBullets / ShootBullet - bullet tracing with damage, impulse and hitbox tags Weapon hold types editor Animgraph enum parameters can be set by option name - Renderer.Set( "holdtype", "pistol" ) NpcUsage on BaseWeapon - engagement range and burst behaviour so NPCs can use any weapon ICameraModifier - cameras compose their view through an ordered modifier chain, read the result from CameraComponent.View CameraEffectSystem - screen shake, directional punches and tilts, with world epicenter falloff - camera.AddShake / AddPunch / AddTilt EnvShake component - shakes the view, rumbles controllers, kicks physics TracerEffect - an animated tracer line, ITargetedEffect for effects that fly at a target SceneAnchor - a world position that can follow an object or bone SkinnedModelRenderer.GetClosestBone( worldPosition ) Vector3.WithAimCone can take a custom Random for reproducible spread Improve/Fix PlayerController searches parents for IPressable when pressing PlayerController camera runs through the modifier chain - IEvents.PostCameraSetup is obsolete SoundPlayer preview uses shortcuts - Space toggles playback, Ctrl+Space restarts Fixed Radius( 0 ) traces missing everything Fixed NRE in AssetPreviewWidget Removed Removed CameraComponent.ISceneCameraSetup (obsolete since October, nothing uses)
140 lines
4.1 KiB
Modula-2
140 lines
4.1 KiB
Modula-2
|
|
#include "scenesystem/sceneanimatableobject.h"
|
|
|
|
delegate SboxAnimationEventCallback;
|
|
delegate SboxAnimTagEventCallback;
|
|
delegate SboxAnimGraphChangedCallback;
|
|
|
|
[Handle:Sandbox.SceneModel]
|
|
native class CSceneAnimatableObject as NativeEngine.CSceneAnimatableObject : CSceneObject
|
|
{
|
|
[nogc]
|
|
void SetWorldSpaceRenderBoneTransform( int nBoneIndex, Transform pRenderWorldTransform );
|
|
[nogc]
|
|
Transform GetWorldSpaceRenderBoneTransform( int nBoneIndex );
|
|
Transform GetWorldSpaceRenderBoneTransform( string boneName );
|
|
[nogc]
|
|
Transform GetWorldSpaceRenderBonePreviousTransform( int nBoneIndex );
|
|
Transform GetWorldSpaceRenderBonePreviousTransform( string boneName );
|
|
[nogc]
|
|
Transform GetLocalSpaceRenderBoneTransform( int nBoneIndex );
|
|
Transform GetLocalSpaceRenderBoneTransform( string boneName );
|
|
[nogc]
|
|
Transform GetWorldSpaceAnimationTransform( int nBoneIndex );
|
|
|
|
[nogc]
|
|
void GetWorldSpaceRenderBoneTransforms( int nNumBones, void* pOut );
|
|
[nogc]
|
|
void GetWorldSpaceRenderBonePreviousTransforms( int nNumBones, void* pOut );
|
|
[nogc]
|
|
int GetClosestBoneIndex( Vector3 vWorldPoint );
|
|
|
|
void Update( float dt );
|
|
void MergeFrom( CSceneAnimatableObject other );
|
|
void SetBindPose();
|
|
void CalculateWorldSpaceBones();
|
|
void FinishUpdate();
|
|
|
|
void ResetGraphParameters();
|
|
|
|
[nogc]
|
|
Transform GetParentSpaceBone( int index );
|
|
[nogc]
|
|
void GetParentSpaceBones( int nNumBones, void* pOut );
|
|
void SetParentSpaceBone( int index, Transform tx );
|
|
|
|
void InitAnimGraph( SboxAnimGraphChangedCallback pAnimGraphChangedCallback );
|
|
void SetAnimGraph( string graphName );
|
|
|
|
void SetAnimGraph( HAnimationGraph hGraph );
|
|
HAnimationGraph GetAnimGraph();
|
|
|
|
void SBox_SetFlexOverride( StringToken name, float flWeight, float flFadeTime );
|
|
void SBox_SetFlexOverride( int flexId, float flWeight, float flFadeTime );
|
|
float SBox_GetFlexOverride( int flexId );
|
|
float SBox_GetFlexOverride( StringToken name );
|
|
void SBox_ClearFlexOverride( float flFadeTime );
|
|
void SBox_ClearFlexOverride( StringToken name, float flFadeTime );
|
|
void SBox_ClearFlexOverride( int flexId, float flFadeTime );
|
|
|
|
void DirectPlayback_PlaySequence( string pSequenceName );
|
|
void DirectPlayback_PlaySequence( string pSequenceName, Vector3 vTargetPos, float flFacingHeading, float flInterpTime );
|
|
void DirectPlayback_CancelSequence();
|
|
float DirectPlayback_GetSequenceCycle();
|
|
stable string DirectPlayback_GetSequence();
|
|
void DirectPlayback_SetSequenceStartTime( float flStartTime );
|
|
float DirectPlayback_GetSequenceDuration();
|
|
|
|
bool SBox_GetAttachment( StringToken name, bool worldspace, cref out Transform tx );
|
|
|
|
void SetShouldUseAnimGraph( bool bEnabled );
|
|
bool GetShouldUseAnimGraph();
|
|
|
|
stable string GetSequence();
|
|
void SetSequence( string pSequenceName );
|
|
|
|
float GetSequenceDuration();
|
|
|
|
float GetSequenceCycle();
|
|
void SetSequenceCycle( float flCycle );
|
|
|
|
void SetSequenceLooping( bool bLooping );
|
|
bool IsSequenceFinished();
|
|
void SetSequenceBlending( bool bBlending );
|
|
|
|
float GetPlaybackRate();
|
|
void SetPlaybackRate( float flPlaybackRate );
|
|
|
|
int GetParameterInt( string name );
|
|
Float GetParameterFloat( string name );
|
|
Vector3 GetParameterVector3( string name );
|
|
Rotation GetParameterRotation( string name );
|
|
|
|
//
|
|
// Anim Events
|
|
//
|
|
int PendingAnimationEvents();
|
|
void RunAnimationEvents( SboxAnimationEventCallback callback );
|
|
void DispatchTagEvents( SboxAnimTagEventCallback callback );
|
|
|
|
//
|
|
// Bone Overrides
|
|
//
|
|
[nogc]
|
|
void ClearPhysicsBones();
|
|
[nogc]
|
|
void SetPhysicsBone( ushort bone, Transform transform );
|
|
|
|
Transform GetRootMotion();
|
|
|
|
float m_flDeltaTime;
|
|
|
|
inline bool HasPhysicsBones()
|
|
{
|
|
return self->m_PhysicsBoneTransform.Count() > 0;
|
|
}
|
|
|
|
IAnimParameterInstance GetAnimParameter( string name );
|
|
IAnimParameterInstance GetAnimParameter( int index );
|
|
|
|
BBox m_worldBounds;
|
|
BBox m_localBounds;
|
|
}
|
|
|
|
native class IAnimParameterInstance as NativeEngine.IAnimParameterInstance
|
|
{
|
|
void SetValue( bool val );
|
|
void SetValue( int val );
|
|
void SetValue( float val );
|
|
void SetValue( Vector3 val );
|
|
void SetValue( Rotation val );
|
|
inline void SetEnumValue( int val )
|
|
{
|
|
self->SetValue( CAnimEnum( (AnimEnumValue_t)val ) );
|
|
}
|
|
|
|
CUtlString GetName();
|
|
bool IsAutoReset();
|
|
|
|
NativeEngine.AnimParamType GetParameterType();
|
|
} |