Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
engine
Manage
Activity
Members
Labels
Plan
Redmine
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sip
engine
Commits
45b8a846
Commit
45b8a846
authored
4 years ago
by
D-AIRY
Browse files
Options
Downloads
Patches
Plain Diff
Fixed hud weapon jitter
parent
325ecd33
No related branches found
Branches containing commit
Tags
version_X.9.1-dev
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
source/game/BaseTool.cpp
+26
-1
26 additions, 1 deletion
source/game/BaseTool.cpp
with
26 additions
and
1 deletion
source/game/BaseTool.cpp
+
26
−
1
View file @
45b8a846
...
@@ -60,6 +60,31 @@ END_PROPTABLE()
...
@@ -60,6 +60,31 @@ END_PROPTABLE()
REGISTER_ENTITY_NOLISTING
(
CBaseTool
,
base_tool
);
REGISTER_ENTITY_NOLISTING
(
CBaseTool
,
base_tool
);
class
btKinematicClosestNotMeRayResultCallback
:
public
btCollisionWorld
::
ClosestRayResultCallback
{
public:
btKinematicClosestNotMeRayResultCallback
(
btCollisionObject
*
me
,
const
btVector3
&
rayFromWorld
,
const
btVector3
&
rayToWorld
)
:
btCollisionWorld
::
ClosestRayResultCallback
(
rayFromWorld
,
rayToWorld
)
{
m_me
=
me
;
m_shapeInfo
=
{
-
1
,
-
1
};
}
virtual
btScalar
addSingleResult
(
btCollisionWorld
::
LocalRayResult
&
rayResult
,
bool
normalInWorldSpace
)
{
if
(
rayResult
.
m_collisionObject
==
m_me
)
return
1.0
;
if
(
rayResult
.
m_localShapeInfo
)
{
m_shapeInfo
=
*
rayResult
.
m_localShapeInfo
;
}
return
ClosestRayResultCallback
::
addSingleResult
(
rayResult
,
normalInWorldSpace
);
}
btCollisionWorld
::
LocalShapeInfo
m_shapeInfo
;
protected
:
btCollisionObject
*
m_me
;
};
CBaseTool
::
CBaseTool
(
CEntityManager
*
pMgr
)
:
CBaseTool
::
CBaseTool
(
CEntityManager
*
pMgr
)
:
BaseClass
(
pMgr
),
BaseClass
(
pMgr
),
m_bInPrimaryAction
(
false
),
m_bInPrimaryAction
(
false
),
...
@@ -248,7 +273,7 @@ void CBaseTool::_update(float dt)
...
@@ -248,7 +273,7 @@ void CBaseTool::_update(float dt)
float3
start
=
m_pParent
->
getPos
();
float3
start
=
m_pParent
->
getPos
();
float3
dir
=
m_pParent
->
getOrient
()
*
float3
(
0.0
f
,
0.0
f
,
1.0
f
);
float3
dir
=
m_pParent
->
getOrient
()
*
float3
(
0.0
f
,
0.0
f
,
1.0
f
);
float3
end
=
start
+
dir
*
m_fCenterLength
;
float3
end
=
start
+
dir
*
m_fCenterLength
;
bt
CollisionWorld
::
ClosestRayResultCallback
cb
(
F3_BTVEC
(
start
),
F3_BTVEC
(
end
));
bt
Kinematic
Closest
NotMe
RayResultCallback
cb
(
((
CBaseCharacter
*
)
m_pOwner
)
->
getBtCollisionObject
(),
F3_BTVEC
(
start
),
F3_BTVEC
(
end
));
SPhysics_GetDynWorld
()
->
rayTest
(
F3_BTVEC
(
start
),
F3_BTVEC
(
end
),
cb
);
SPhysics_GetDynWorld
()
->
rayTest
(
F3_BTVEC
(
start
),
F3_BTVEC
(
end
),
cb
);
m_isClose
=
cb
.
hasHit
();
m_isClose
=
cb
.
hasHit
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment