rstralberg
Member
|
[Solved] Accessing slots?
Simple question. How do I access a slot from code?
(This post was last modified: 05-16-2015 09:34 PM by rstralberg.)
|
|
05-13-2015 11:55 PM |
|
RedcrowProd
Member
|
RE: Accessing slots?
what do you mean by slot ?
if you mean the slot of the char, for example to have something equipped:
in the inventory tuto you can found this
Code:
void update(Player &owner) // handle moving items with mouse and setting equipped item matrixes
{
if(inv_gui)inv_gui.update(owner);
// set matrixes for items in hands
if(slot[SLOT_ARM_L].valid())
if(C OrientP *point=owner.skel.findPoint(8"HandL"))
slot[SLOT_ARM_L]().matrix(Matrix().setPosDir(point.pos, point.perp, point.dir));
if(slot[SLOT_ARM_R].valid())
if(C OrientP *point=owner.skel.findPoint(8"HandR"))
slot[SLOT_ARM_R]().matrix(Matrix().setPosDir(point.pos, point.perp, point.dir));
}
if(C OrientP *point=owner.skel.findPoint(8"HandL")) this is what i believe you are looking for.
(This post was last modified: 05-14-2015 03:52 AM by RedcrowProd.)
|
|
05-14-2015 03:44 AM |
|
rstralberg
Member
|
RE: Accessing slots?
Yep. That worked. It was this I was out for
owner.skel.findPoint(8"HandL"))
|
|
05-14-2015 08:44 PM |
|