Raised This Month: $404 Target: $400
 101% 

Module: BMOD - Extended Physics Module


Post New Thread Reply   
 
Thread Tools Display Modes
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 02-16-2012 , 05:08   Re: Module: BMOD - Extended Physics Module
Reply With Quote #21

The only thing that I would suggest with this module is to make it an interface to all the possible functions of the Bullet physics.

Also it would be a good idea to add get natives.
For example: bmod_get_friction and is_bmod_registered.

And forwards if the bmod library can offer.

Also request for the mods of the forums.
Sticky PLEASEEE!!!
__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.
ot_207 is offline
Backup
Senior Member
Join Date: Jul 2010
Location: Česká Republika
Old 02-17-2012 , 11:39   Re: Module: BMOD - Extended Physics Module
Reply With Quote #22

Ok, added more natives, look at the include file for complete list.
In this video i'm using last bullet hit for traceline end point because i'm too lazy to get it from player angles. I set gravity (or apply force at hit point) of traced object by console bind.
http://www.youtube.com/watch?v=fAJlHJehlI8

So if you want objects reacting to bullets or explosions, use bmod_traceline and bmod_object_apply_force_at (this takes relative position, so substract it from entity origin).
__________________
Sorry for my english.
Backup is offline
mabaclu
Senior Member
Join Date: Jun 2010
Location: Portugal
Old 02-17-2012 , 17:22   Re: Module: BMOD - Extended Physics Module
Reply With Quote #23

What about joining objects? It would allow coders to make more complex objects by joining cylinders, cones, boxes, etc.
__________________

Last edited by mabaclu; 02-17-2012 at 17:23.
mabaclu is offline
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 02-18-2012 , 02:27   Re: Module: BMOD - Extended Physics Module
Reply With Quote #24

Quote:
Originally Posted by Backup View Post
Ok, added more natives, look at the include file for complete list.
In this video i'm using last bullet hit for traceline end point because i'm too lazy to get it from player angles. I set gravity (or apply force at hit point) of traced object by console bind.
http://www.youtube.com/watch?v=fAJlHJehlI8

So if you want objects reacting to bullets or explosions, use bmod_traceline and bmod_object_apply_force_at (this takes relative position, so substract it from entity origin).
Beautiful. I will make a physics plugin soon .

Things that I like to request:
1. Module autoloading
2. Some forwards, don't know if the bmod library has something like that.
3. Also I think that it would be a good idea to make the object properties set function just like engine this is good when this module will provide more and more functions that we can play with. bmod_set_float(ent, BM_gravity/BM_restitution, gravity).

Quote:
Originally Posted by mabaclu View Post
What about joining objects? It would allow coders to make more complex objects by joining cylinders, cones, boxes, etc.
Another alternative to your suggestion would be to make the bullet engine support custom models. Like the player models for instance, though I don't know if this bullet physics will be able to support this.
__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.
ot_207 is offline
Backup
Senior Member
Join Date: Jul 2010
Location: Česká Republika
Old 02-18-2012 , 14:56   Re: Module: BMOD - Extended Physics Module
Reply With Quote #25

Quote:
Originally Posted by ot_207 View Post
1. Module autoloading
Sorry, i don't get it, what is it?
Anyway i've done everything else: engine-like variables handling and one simple callback called when body contact is made. You can use it for sound effects, as i tried to in this video:
http://www.youtube.com/watch?v=0tpyPSHG96s
Quote:
Originally Posted by ot_207 View Post
Another alternative to your suggestion would be to make the bullet engine support custom models. Like the player models for instance, though I don't know if this bullet physics will be able to support this.
Player models are too complex for physics simulation. I'm going to add support for model trimesh (including both map brush model (beginning with *) and studio model (.mdl files)).
__________________
Sorry for my english.
Backup is offline
zeus
Senior Member
Join Date: Jul 2008
Old 02-18-2012 , 15:03   Re: Module: BMOD - Extended Physics Module
Reply With Quote #26

Module autoloading means when a plugin is using the module it will autoload even if it is not enabled from modules.ini ( i guess )

Last edited by zeus; 02-18-2012 at 15:03.
zeus is offline
mabaclu
Senior Member
Join Date: Jun 2010
Location: Portugal
Old 02-18-2012 , 18:10   Re: Module: BMOD - Extended Physics Module
Reply With Quote #27

The "callback when body contact is made" is not working, can you give me an example script please?
__________________
mabaclu is offline
Backup
Senior Member
Join Date: Jul 2010
Location: Česká Republika
Old 02-18-2012 , 18:28   Re: Module: BMOD - Extended Physics Module
Reply With Quote #28

You have to call bmod_object_set_callback(entity,1) on objects you want to get callback from.
Code:
public whatever(){
    ...
    new Float:size[3] = {24.0,24.0,24.0}
    bmod_object_add(entity,BMOD_sphere,1.0,size)
    bmod_object_set_callback(entity,1)
}
public bmod_forward_contact(ent1,ent2,Float:distance){
    ...
}
If you don't want to get callback anymore, call bmod_object_set_callback(entity,0).

Is this bad 'feature'? Should every object call this callback automaticly?
__________________
Sorry for my english.

Last edited by Backup; 02-18-2012 at 18:29.
Backup is offline
mabaclu
Senior Member
Join Date: Jun 2010
Location: Portugal
Old 02-18-2012 , 18:34   Re: Module: BMOD - Extended Physics Module
Reply With Quote #29

Look at my code, it's not working. Nothing happens when 2 balls collide:
Code:
#include <amxmodx>
#include <engine>
#include <fakemeta>
#include <bmod>

public plugin_init() {
	register_plugin("bmod_test","0","asdf")
	register_concmd("bmod_test","_bmod_test")
}

public _bmod_test(id){
	new entity = create_entity("func_wall")
	entity_set_model(entity,"models/fyzsph.mdl")
	new Float:origin[3]
	entity_get_vector(id,EV_VEC_origin,origin)
	origin[2]+=128
	entity_set_origin(entity,origin)
	entity_set_float(entity,EV_FL_nextthink,86400.0)
	entity_set_int(entity,EV_INT_movetype,8)
	new Float:size[3] = {24.0,24.0,24.0}
	bmod_object_add(entity,BMOD_sphere,1.0,size)
	new Float:gravity[3] = {0.0,0.0,-2.0}
	bmod_object_set_vector(entity, BMOD_VEC_gravity, gravity)
	bmod_object_set_callback(entity,1)
}
public plugin_precache(){
	precache_model("models/fyzsph.mdl")
}

public bmod_forward_contact(ent1,ent2,Float:distance){
	client_print(0, print_chat, "ent1: %i; ent2: %i; distance: %f", ent1, ent2, distance)
}
Quote:
Originally Posted by Backup View Post
Is this bad 'feature'? Should every object call this callback automaticly?
Detecting collisions is a great feature but _set_callback may be an useless native.

I've looked at the source code and i don't see bmod_forward_contact. Did you forget it?
__________________

Last edited by mabaclu; 02-18-2012 at 18:54.
mabaclu is offline
GordonFreeman (RU)
Veteran Member
Join Date: Jan 2010
Location: Uzbekistan
Old 02-18-2012 , 23:30   Re: Module: BMOD - Extended Physics Module
Reply With Quote #30

Can i add bmod physics for other in game ents? Not creating new ent.
(example. granades with bmod physics)
__________________
The functional way is the right way
GordonFreeman (RU) is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 17:58.


Powered by vBulletin®
Copyright ©2000 - 2018, vBulletin Solutions, Inc.
Theme made by Freecode