Ru/$bodygroup: Difference between revisions
< Ru
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 4: | Line 4: | ||
'''$bodygroup''' это [[QC command]] позволяющая создавать ячейки/подгруппы для изменения внешнего вида модели. | '''$bodygroup''' это [[QC command]] позволяющая создавать ячейки/подгруппы для изменения внешнего вида модели. | ||
{{note| | {{note|Боди0группы не могут изменять [[skeleton]] или [[collision model]].}} | ||
== Пример == | == Пример == | ||
Line 30: | Line 30: | ||
Эта боди-группа позволяет сменять вид брони на теле игрока. | Эта боди-группа позволяет сменять вид брони на теле игрока. | ||
{{note|Since polygons never share vertices in Source models, there need not be seams between properly-made components.}} | |||
== Программирование == | |||
Чтобы изменить состояние боди-группы: | |||
<source lang=cpp> | |||
static int BodyGroup_Sights = FindBodygroupByName("sights"); // calculate this value once | |||
SetBodygroup( BodyGroup_Sights , 1 ); // laser dot | |||
</source> | |||
By default, <code>[[CBaseAnimating]]</code> supports 4,294,967,296 combinations (32 bits), and <code>[[CBaseViewModel]]</code> supports 256 (8 bits). You can raise either of these by editing the relevant [[SendProp]] for <code>m_nBody</code>. | |||
To calculate how many combinations you need, multiply the size of all your bodygroups together. The examples on this page total 3 * 4 = 12...but add two more groups the same size and you're up at 144. The figure grows exponentially. | |||
[[Category:QC Commands]] |
Revision as of 10:27, 6 October 2013
Template:Otherlang2 $bodygroup это QC command позволяющая создавать ячейки/подгруппы для изменения внешнего вида модели.

Пример
$bodygroup sights
{
studio "ironsights.smd"
studio "laser_dot.smd"
<...>
}
Эта боди-группа позволяет оружию иметь несколько составных частей, например прицел, глушитель и.т.п.
$bodygroup chest
{
studio "chest_with_no_armor.smd"
studio "chest_with_light_armor.smd"
studio "chest_with_heavy_armor.smd"
studio "chest_with_super_armor.smd"
}
Эта боди-группа позволяет сменять вид брони на теле игрока.

Программирование
Чтобы изменить состояние боди-группы:
static int BodyGroup_Sights = FindBodygroupByName("sights"); // calculate this value once
SetBodygroup( BodyGroup_Sights , 1 ); // laser dot
By default, CBaseAnimating
supports 4,294,967,296 combinations (32 bits), and CBaseViewModel
supports 256 (8 bits). You can raise either of these by editing the relevant SendProp for m_nBody
.
To calculate how many combinations you need, multiply the size of all your bodygroups together. The examples on this page total 3 * 4 = 12...but add two more groups the same size and you're up at 144. The figure grows exponentially.