Bug 3527 - requesting natives for the collision model
requesting natives for the collision model
Status: RESOLVED FIXED
Product: AMX Mod X
Classification: Unclassified
Component: Core
trunk
PC All
: P3 normal
Assigned To: amxmodx-bugs@alliedmods.net
: needsinput
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-12-28 07:31 PST by reyemniwre
Modified: 2014-02-08 23:52 PST (History)
4 users (show)

See Also:


Attachments
Proposed patch (7.79 KB, patch)
2013-07-02 11:06 PDT, Vincent Herbet [:Arkshine]
hv.contact: review+
Details | Diff | Splinter Review
Call me now Spaces Killer. (7.64 KB, patch)
2013-07-02 11:49 PDT, Vincent Herbet [:Arkshine]
hv.contact: review+
joropito: feedback+
Details | Diff | Splinter Review

Description reyemniwre 2008-12-28 07:31:48 PST
hi

first of all, i dont understand half of this reporting system so i want to appologize if i did something wrong which i probably did :/
anyway, i want to request two natives: one natives with which you can retrieve the collision models origin and once with which you can set this origin.

thanks in advance
Comment 1 reyemniwre 2009-01-01 10:19:47 PST
additionally i should add that the collision models origin is saved in cs demos but so far no amxx native exists for retrieving this data.
Comment 2 joropito 2013-06-26 06:22:36 PDT
I guess this is about reading mins/maxs and origin from model_t struct
Comment 3 joropito 2013-06-26 06:25:51 PDT
Edit: from dmodel_t (from submodels from model_t)
Comment 4 Vincent Herbet [:Arkshine] 2013-07-02 11:06:22 PDT
Created attachment 3420 [details] [review]
Proposed patch

I'm willing to add this as it has been already asked several times, is useful and easy to implement.

All tested successfully.
Comment 5 David Anderson [:dvander] 2013-07-02 11:09:16 PDT
Comment on attachment 3420 [details] [review]
Proposed patch

>diff -r 47c47df488e8 dlls/fakemeta/misc.cpp
>--- a/dlls/fakemeta/misc.cpp	Tue Jul 02 16:05:39 2013 +0200
>+++ b/dlls/fakemeta/misc.cpp	Tue Jul 02 20:01:24 2013 +0200
>@@ -150,12 +150,181 @@
> 	return amx_ftoc(setting * (1.0 / 255.0) * (pbonecontroller->end - pbonecontroller->start) + pbonecontroller->start);
> }
> 
>+enum
>+{
>+	Model_DefaultSize		= -2,
>+	Model_CurrentSequence	= -1,
>+};
> 
>+// GetModelCollisionBox( index, Float:mins[3], Float:maxs[3] );
>+static cell AMX_NATIVE_CALL GetModelCollisionBox( AMX *amx, cell *params )

Just a note, since I've seen this style start to pop up: AMX Mod X doesn't put a space around parentheses like this. For consistency, it's best to prefer the local style:

> static cell AMX_NATIVE_CALL GetModelCollisionBox(AMX *amx, cell *params)
Comment 6 David Anderson [:dvander] 2013-07-02 11:11:32 PDT
Comment on attachment 3420 [details] [review]
Proposed patch

Review of attachment 3420 [details] [review]:
-----------------------------------------------------------------

::: dlls/fakemeta/misc.cpp
@@ +164,5 @@
> +	CHECK_ENTITY( entityIndex );
> +
> +	edict_t *pEdict = INDEXENT2( entityIndex );
> +
> +	if( !FNullEnt( pEdict ) )

Similarly,

> if (!FNullEnt(pEdict))

Is AMX Mod X style.
Comment 7 Vincent Herbet [:Arkshine] 2013-07-02 11:23:07 PDT
Oh. I understand. From now, I will follow the original style even though I find  it way less readable.
Comment 8 Vincent Herbet [:Arkshine] 2013-07-02 11:49:45 PDT
Created attachment 3421 [details] [review]
Call me now Spaces Killer.
Comment 9 Vincent Herbet [:Arkshine] 2013-07-04 11:45:30 PDT
Pushed changeset: http://hg.alliedmods.net/amxmodx-central/rev/a4e667e91410
Changelog:
	Add [Get|Set]ModelCollisionBox and [Get|Set]ModelBoundingBox (bug 3527, r=joropito)
Comment 10 AM Bugzilla Bot 2014-02-08 23:52:27 PST
Commit pushed to master at https://github.com/alliedmodders/amxmodx

https://github.com/alliedmodders/amxmodx/commit/83e70d7dd7fbfca3b4e6e8aa9f7583932ec22e92
Add [Get|Set]ModelCollisionBox and [Get|Set]ModelBoundingBox (bug 3527, r=joropito)


Former-commit-id: 4d174007b14a9b6b8589f96a9259f3249db23799

Note You need to log in before you can comment on or make changes to this bug.