Inheritance: BaseModelBody
Exemple #1
0
        /// <summary>
        /// Creates ChainMember wrap over the Body with additional properies from Tags
        /// </summary>
        /// <param name="body">Original Body</param>
        /// <param name="modelId">Id of the parent Game Object Model</param>
        /// <returns>The copy of original Body</returns>
        public static ChainMember Create(Body body, Guid modelId)
        {
            var result = new ChainMember(body.State, body.Shape, body.Mass, body.Coefficients, body.Lifetime, modelId);
            object j1, j2;

            body.Tags.TryGetValue("J1", out j1);
            body.Tags.TryGetValue("J2", out j2);

            result.BegJoint = j1 as Joint;
            result.EndJoint = j2 as Joint;

            return result;
        }
Exemple #2
0
        /// <summary>
        /// Creates ChainMember wrap over the Body with additional properies from Tags
        /// </summary>
        /// <param name="body">Original Body</param>
        /// <param name="modelId">Id of the parent Game Object Model</param>
        /// <returns>The copy of original Body</returns>
        public static ChainMember Create(Body body, Guid modelId)
        {
            var    result = new ChainMember(body.State, body.Shape, body.Mass, body.Coefficients, body.Lifetime, modelId);
            object j1, j2;

            body.Tags.TryGetValue("J1", out j1);
            body.Tags.TryGetValue("J2", out j2);

            result.BegJoint = j1 as Joint;
            result.EndJoint = j2 as Joint;

            return(result);
        }